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 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

Pull Requests

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: Fri Dec 27 00:01:30 2024 UTC