php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #31338 Infinite recursion protection needs error
Submitted: 2004-12-29 21:53 UTC Modified: 2004-12-29 22:39 UTC
From: jed@php.net Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.0.3 OS: Windows XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jed@php.net
New email:
PHP Version: OS:

 

 [2004-12-29 21:53 UTC] jed@php.net
Description:
------------
F:\>php -v
PHP 5.0.3 (cli) (built: Dec 15 2004 08:07:57)

Infinite recursion is predictably terminated, but the Zend Engine produces no output to that effect (at least in CLI). At least a E_WARNING should be emitted to warn developers that this is really what happened (as it might not be clear).

Reproduce code:
---------------
<?php
/* php/bugs/recursive.php5
 * Infinite recursion protection needs error
 */

$i = 0;
function iWillRecurse() {
  global $i;
  printf("Recursions: %7s\n", number_format(++$i));
  iWillRecurse();
}

iWillRecurse();

Expected result:
----------------
F:\>php -f php\bugs\recursive.php5
..
Recursions:   6,283
Recursions:   6,284
Warning: Infinite recursion in F:\php\bugs\recursive.php5 on line 10

F:\>

Actual result:
--------------
F:\>php -f php\bugs\recursive.php5
..
Recursions:   6,283
Recursions:   6,284

F:\>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-29 22:39 UTC] derick@php.net
This was requested before, and this can NOT be done in a nice way.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 06:01:34 2025 UTC