|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-02-23 11:14 UTC] pollita@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: pollita
[2013-02-23 11:14 UTC] pollita@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Description: ------------ Methods being added as RUNKIT_ACC_PUBLIC seem to somehow have lost their access level when they are inspected through Reflection. When a class containing such a method gets extended by another class that overwrites this method and is loaded later on an error gets thrown: "Access level to C::x() must be (as in class A) or weaker" I've found this in php 5.1.0RC6 as well in previous 5.1.0RC versions. I haven't tested with other php versions. Reproduce code: --------------- // does not have a 'public' identifier in Reflection export: class A {} runkit_method_add ('A', 'x', '', '', RUNKIT_ACC_PUBLIC); Reflection::export(new ReflectionMethod('A', 'x')); // works perfectly well: class B extends A { public function x() {} } Reflection::export(new ReflectionMethod('B', 'x')); // throws an error: include('C.php'); // with C.php being: <?php class C extends A { public function x() {} } ?> Reflection::export(new ReflectionMethod('C', 'x')); Expected result: ---------------- Method [ public method x ] { @@ (...) } Method [ public method x ] { @@ (...) } Method [ public method x ] { @@ (...) } Actual result: -------------- Method [ method x ] { @@ (...) } Method [ public method x ] { @@ (...) } Fatal error: Access level to C::x() must be (as in class A) or weaker in (...)