forked from zenovich/runkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 57649 (https://bugs.php.net/bug.php?id=57649) has been fixed with…
…out apathy ;) New tests from github.com/php/pecl-php-runkit have been added (thanks to sgolemon). Some memory allocation problems have been resolved.
- Loading branch information
Showing
17 changed files
with
407 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--TEST-- | ||
Bug#56662 - Wrong access level with RUNKIT_ACC_PUBLIC | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit")) print "skip"; | ||
if(version_compare(PHP_VERSION, '5.0.0', '<')) print "skip"; | ||
?> | ||
--FILE-- | ||
<?php | ||
class A {} | ||
runkit_method_add ('A', 'x', '', '', RUNKIT_ACC_PUBLIC); | ||
Reflection::export(new ReflectionMethod('A', 'x')); | ||
|
||
class B extends A { public function x() {} } | ||
Reflection::export(new ReflectionMethod('B', 'x')); | ||
|
||
eval("class C extends A { public function x() {} }"); | ||
Reflection::export(new ReflectionMethod('C', 'x')); | ||
|
||
--EXPECTF-- | ||
Method [ <user%S> public method x ] { | ||
@@ %s/tests/bug56662.php(3) : runkit runtime-created function 1 - 1 | ||
} | ||
|
||
Method [ <user, overwrites A%S> public method x ] { | ||
@@ %s/tests/bug56662.php 6 - 6 | ||
} | ||
|
||
Method [ <user, overwrites A, prototype A> public method x ] { | ||
@@ %s/tests/bug56662.php(9) : eval()'d code 1 - 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--TEST-- | ||
Bug#56976 - Failure adding __call method | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit")) print "skip"; | ||
if(version_compare(PHP_VERSION, '5.0.0', '<')) print "skip"; | ||
?> | ||
--FILE-- | ||
<?php | ||
class ParentClass | ||
{ | ||
public function foo() | ||
{ | ||
echo "ParentClass::foo\n"; | ||
} | ||
} | ||
|
||
class ChildClass extends ParentClass { } | ||
|
||
var_dump(runkit_method_add('ParentClass', '__call', '$method, $args', | ||
'echo "In ParentClass::__call()\n";' . | ||
'call_user_func_array(array($this, "prefix_{$method}"), $args);')); | ||
|
||
var_dump(runkit_method_rename('ChildClass', 'foo', 'prefix_foo')); | ||
|
||
$o = new ChildClass; | ||
$o->foo(); | ||
|
||
--EXPECT-- | ||
bool(true) | ||
bool(true) | ||
In ParentClass::__call() | ||
ParentClass::foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
class cBuggyClass { | ||
public function mBuggyMethod() { | ||
static $ls_a_iCache; | ||
echo 'mBuggyMethod();'.PHP_EOL; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
Bug#57249 - Sutdown bug with runkit_import on a function-static variable | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit")) print "skip"; | ||
if(version_compare(PHP_VERSION, '5.0.0', '<')) print "skip"; | ||
?> | ||
--FILE-- | ||
<?php | ||
runkit_import('bug57249.inc', RUNKIT_IMPORT_CLASS_METHODS); | ||
$g_oBuggyObject = new cBuggyClass(); | ||
$g_oBuggyObject->mBuggyMethod(); | ||
|
||
class cBuggyClass { } | ||
|
||
--EXPECT-- | ||
mBuggyMethod(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
class a { | ||
public function foo() { | ||
echo "foo()\n"; | ||
} | ||
} | ||
|
||
class c { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
Bug#57649 - runkit_import() - methods not added - multiple classes in one file | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit")) print "skip"; | ||
if(version_compare(PHP_VERSION, '5.0.0', '<')) print "skip"; | ||
?> | ||
--FILE-- | ||
<?php | ||
class b { | ||
public function foobar() { | ||
echo "foobar()\n"; | ||
} | ||
} | ||
|
||
class a extends b { } | ||
|
||
runkit_import( dirname(__FILE__) . "/bug57649.inc" ); | ||
|
||
$a = new a(); | ||
$a->foobar(); | ||
$a->foo(); | ||
var_dump(class_exists('c')); | ||
--EXPECT-- | ||
foobar() | ||
foo() | ||
bool(true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
Bug#57658 - runkit_class_adopt fails on method names with capitals | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit")) print "skip"; ?> | ||
--FILE-- | ||
<?php | ||
if (version_compare(phpversion(), "5.0.0") >= 0) { | ||
error_reporting(E_ALL & ~E_STRICT); | ||
} | ||
|
||
class A { function aB() { print "a";} function aC() { echo "d"; } } | ||
class B { function aB() { print "b";} } | ||
runkit_class_adopt("B", "A"); | ||
B::aC(); | ||
--EXPECT-- | ||
d |
Oops, something went wrong.