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
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: 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-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 21:01:25 2019 UTC