|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55031 php exits (with code 0) on 'new ReflectionClass(X)'
Submitted: 2011-06-10 21:00 UTC Modified: 2013-02-18 00:34 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ajrattink at correct dot net Assigned:
Status: No Feedback Package: Reflection related
PHP Version: 5.3.6 OS: Linux 2.4.25
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
46 - 23 = ?
Subscribe to this entry?

 [2011-06-10 21:00 UTC] ajrattink at correct dot net
Creating a working example failed. And we have a codebase of >10MB phpcode.

But these are the exact conditions of the failure:

We have a class B that extends A. Both have a method f() but they differ such that a syntaxcheck would say this:
Strict Standards: Declaration of B::f() should be compatible with that of A::f().
However B is loaded using __autoload('B'), normally.

Now we say (without B loaded) 
  $a = new ReflectionClass('B');
And php exits with code 0. No logging, no error, no Exception, no SEGV.

some added debugprints in reflection_class_object_ctor() show this: 
ARA: reflection_class_object_ctor entry
ARA: calling getThis
ARA: name:'MO_KieskeurigExporter', calling zend_lookup_class

And I never return from zend_lookup_class!
Unfortunately putting a print in there probably floods the system here.
Working around the bug is much easier than debugging it. But maybe someone
more knowledgeable than me knows where that exit(0); call is parked??

Test script:
Not reproducable.

Expected result:
I accept an ReflectionException to be thrown. This does happen if I change the classname, so it truly cannot be found. Also, if I fix the method to match the superclass' one, everything is fine as well. 

Actual result:
php exits with code 0.

However a minimal example attempt worked perfectly ok. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-06-11 00:46 UTC]
-Status: Open +Status: Feedback
 [2011-06-11 00:46 UTC]
Check your autoload function.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 23:01:28 2024 UTC