php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55193 virtual() loop with null parameter
Submitted: 2011-07-12 15:04 UTC Modified: 2011-09-17 09:12 UTC
From: jinmoku at hotmail dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.4.0alpha1 OS: OSX 10.6
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jinmoku at hotmail dot com
New email:
PHP Version: OS:

 

 [2011-07-12 15:04 UTC] jinmoku at hotmail dot com
Description:
------------
virtual() loop with null parameter, loop 9 times before it stop

Test script:
---------------
var_dump('test');
virtual(null); // or virtual('');

Expected result:
----------------
string(4) "test"

Warning: virtual(): Unable to include '' - error finding URI


Actual result:
--------------
string(4) "test"

string(4) "test"

string(4) "test"

string(4) "test"

string(4) "test"

string(4) "test"

string(4) "test"

string(4) "test"

string(4) "test"

string(4) "test"

Warning: virtual(): Unable to include '' - error finding URI


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-17 09:12 UTC] nikic@php.net
-Status: Open +Status: Bogus
 [2011-09-17 09:12 UTC] nikic@php.net
As far as I see it this is expected behavior.

I'm assuming that you are running the file as index.php and thus the same file get's included again and again, recursively. Apache stops the recursive inclusion after 10 subrequests, which is the default value for LimitInternalRecursion.

PHP does not prevent recursive subrequests by itself as they are useful as long as you break out of the recursion at some point. For the same reason you can also include/require a file recursively.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC