php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56444 runkit_class_adopt() not work
Submitted: 2005-07-08 09:10 UTC Modified: 2005-07-08 13:22 UTC
From: kozlik at kufr dot cz Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5.0.3 OS: win xp
Private report: No CVE-ID: None
 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-08 09:40 UTC] kozlik at kufr dot cz
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
 [2005-07-08 13:22 UTC] pollita@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Thanks for the detailed bug report!
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 08 20:01:24 2021 UTC