Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RobotLoader kills PHP 5.3.6 #1211

Closed
milo opened this issue Aug 23, 2013 · 3 comments
Closed

RobotLoader kills PHP 5.3.6 #1211

milo opened this issue Aug 23, 2013 · 3 comments

Comments

@milo
Copy link
Member

milo commented Aug 23, 2013

I'm testing applications with PHP 5.3.6 on Windows 7 (don't know if issue is positive on Linux) and I discoverd strange behaviour of RobotLoader.

In application, I get Notice: Undefined index: file on this line. The $info is an empty array.

So, I ran the tests and the test Nette/Loaders/RobotLoader.phpt kills the PHP process.

D:\Aplikace\PHP\5.3.6\php.exe -n Nette\Loaders\RobotLoader.phpt

The bug has been introduced by commit removed usage of Nette\Utils\LimitedScope.

I hope, someone can reproduce it and find why. I can try it, but next week later.

@milo
Copy link
Member Author

milo commented Aug 26, 2013

I reproduced the error on a second PC with Windows 7 and PHP 5.3.6.

The problem is on this line.

# Current problematic code
call_user_func(function() use ($info) { require $info['file']; });
echo "HERE\n";  # see below

Actually, current code pass, HERE message is printed fewtimes as the test is running and PHP dies elsewhere.

When I chage the code in this way, everything works.

# Changed code
call_user_func(function($info) { require $info['file']; }, $info);

It is obviously PHP bug, but I didn't find the appropriate bugfix. Current code is working with PHP 5.3.7. So maybe the #54358 bug is related, because I can see in debug_backtrace() this records, especially note the last one:

[classes:Nette\Loaders\RobotLoader:private] => Array
    (
        [finalclass] => Array
            (
                [file] => E:\dev\nette\tests\Nette\Loaders\files\FinalClass.php
                [time] => 1365081725
                [orig] => FinalClass
            )

        [testclass] => Array
            (
                [Disallowed1] =>
                [Disallowed2] =>
                [Disallowed3] =>
                [Allowed1] =>
            )

        [myspace1\testclass1] => Array
            (
                [file] => E:\dev\nette\tests\Nette\Loaders\files\namespaces1.php
                [time] => 1365081725
                [orig] => MySpace1\TestClass1
            )

        [myspace2\testclass2] => Array
            (
                [disallowed1] => 0
                [disallowed2] => 0
                [disallowed3] => 0
            )

        [myspace3\testclass3] => Array
            (
                [file] => E:\dev\nette\tests\Nette\Loaders\files\namespaces2.php
                [time] => 1365081725
                [orig] => MySpace3\TestClass3
            )

        [testinterface] => Array
            (
                [2892796] =>
# now PHP dies #

Or see the PHP 5.3.7 changelog, it is a lot of bug fixes in this area, including private one.

@rikiless
Copy link

Good point.

@grogy
Copy link

grogy commented Aug 28, 2013

👍

commit #f36f5daab168925ccd1b4f7f35faa434be076dc6 no work on PHP 5.3.6 (was solving - http://forum.nette.org/cs/15256-php-5-3-6-502-na-hostingu-savana-pri-kratsim-contentu)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants