php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56822 Runkit does not rename method correctly
Submitted: 2006-02-05 22:56 UTC Modified: 2013-02-23 22:43 UTC
From: daniel dot oconnor at gmail dot com Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5.0.5 OS: win32
Private report: No CVE-ID: None
 [2006-02-05 22:56 UTC] daniel dot oconnor at gmail dot com
Description:
------------
Either I missed something obvious or it's not quite working right.

I attempt to rename a method; the functions tell me I have succeeded; but then PHP dies when trying to call that method.

PECL 5.0.5
extension=php_gd2.dll
extension=php_mcrypt.dll
extension=php_mhash.dll
extension=php_mysql.dll
extension=php_sockets.dll
extension=php_soap.dll
extension=php_pspell.dll
extension=php_runkit.dll
extension=php_classkit.dll

Reproduce code:
---------------
<?php
class A {
	protected $str = "My String!";

	public function getString() {
		return $this->str;
	}
}


$result = runkit_method_rename('A','getString','CUSTOM_getString');
var_dump($result);
$result = runkit_method_add('A','getString', '', 'return self::CUSTOM_getString();',RUNKIT_ACC_PUBLIC);
var_dump($result);

$a = new A();
print $a->getString();
?>

Expected result:
----------------
bool(true) bool(true) My String!


Actual result:
--------------
bool(true) bool(true)
Fatal error: Call to undefined method A::getString() in C:\vx\tests\runkit.php on line 17


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-21 20:21 UTC] pear dot neufeind at speedpartner dot de
related to #6019; mixed-case doesn't work
 [2009-07-21 20:44 UTC] pear dot neufeind at speedpartner dot de
Re-tested against fix mentioned in #6019, which fixes this issue here as well.
 [2013-02-23 22:43 UTC] pollita@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: pollita
 [2013-02-23 22:43 UTC] pollita@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This got fixed today, it was related to bad case-folding (a lowercase method name 
would have worked)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 17:01:28 2024 UTC