php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35967 control statement "return" problen
Submitted: 2006-01-11 07:15 UTC Modified: 2006-01-11 08:24 UTC
From: sqchen at citiz dot net Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.1.1 OS: redhat 7.3
Private report: No CVE-ID: None
 [2006-01-11 07:15 UTC] sqchen at citiz dot net
Description:
------------
the "return" control statement will cause segfault

Reproduce code:
---------------
<?php
funciton foo()
{
   return foo();
}
foo();

Actual result:
--------------
Segmentation fault

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-11 08:24 UTC] derick@php.net
This has nothing to do with return. You're creating a infinite recursion here (where foo() is calling foo()). This will exhaust the stack and PHP will crash. This is expected behavior.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC