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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 01 10:01:29 2024 UTC