|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-07-08 09:10 UTC] kozlik at kufr dot cz
Description:
------------
I downloaded current version of php_runkit.dll from snaps.php.net today. Bud function runkit_class_adopt() not work. When I try the example from documentation, it return error:
Fatal error: Call to undefined method myChild::parentfunc() in D:\data\http\pokus\runkit.php on line 12
Reproduce code:
---------------
<?php
class myParent {
function parentFunc() {
echo "Parent Function Output\n";
}
}
class myChild {
}
runkit_class_adopt('myChild','myParent');
myChild::parentFunc();
?>
Expected result:
----------------
Parent Function Output\n
Actual result:
--------------
Fatal error: Call to undefined method myChild::parentfunc() in D:\data\http\pokus\runkit.php on line 12
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 17:00:01 2025 UTC |
Now I found that problem is in upcase letter in function definition. Following example work fine: <?php class myParent { function parentfunc() { echo "Parent Function Output\n"; } } class myChild { } runkit_class_adopt('myChild','myParent'); myChild::parentfunc(); myChild::parentFunc(); ?> And one another example which may help with bug fixing: <?php class myParent { function parentFunc() { echo "Parent Function Output\n"; } } class myChild { } runkit_class_adopt('myChild','myParent'); var_dump(get_class_methods ('myChild')); var_dump(get_class_methods ('myParent')); myParent::parentFunc(); myChild::parentFunc(); ?> The result is this: array(1) { [0]=> string(10) "parentFunc" } array(1) { [0]=> string(10) "parentFunc" } Parent Function Output Fatal error: Call to undefined method myChild::parentfunc() in D:\data\http\pokus\runkit.php on line 17