php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56567 runkit_method_add changes value of its argument
Submitted: 2005-09-30 03:27 UTC Modified: 2005-10-31 16:46 UTC
From: skissane at gmail dot com Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5.0.3 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: skissane at gmail dot com
New email:
PHP Version: OS:

 

 [2005-09-30 03:27 UTC] skissane at gmail dot com
Description:
------------
(Version is actually 5.0.5 but it doesn't give me that option...) Using latest runkit.

runkit_method_add changes the case of its class argument to all lowercase, even though it is not documented as being passed by reference.

Somewhat bizarely, if you assign the same string to a different variable (normal assignment, not assignment by reference), it changes both strings!!!!!

Reproduce code:
---------------
<?
class TestClass {
}

$TARGET1 = "TestClass";
$TARGET2 = $TARGET1;
echo "TARGET1=$TARGET1,TARGET2=$TARGET2\n";
runkit_method_add($TARGET1,"foo",'$a','echo "Hello:$a\n";');
echo "TARGET1=$TARGET1,TARGET2=$TARGET2\n";


Expected result:
----------------
TARGET1=TestClass,TARGET2=TestClass
TARGET1=TestClass,TARGET2=TestClass

Actual result:
--------------
TARGET1=TestClass,TARGET2=TestClass
TARGET1=testclass,TARGET2=testclass

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-31 16:46 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.

Fixed in Release 0.7
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 10:01:28 2024 UTC