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.
Rework of runkit_import to allow the fixing of 4519.
- Loading branch information
mlively
committed
May 5, 2008
1 parent
8558df4
commit 2c70ac3
Showing
5 changed files
with
124 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--TEST-- | ||
Bug #4519 Unable to override class definitions of a derived class | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit")) print "skip"; ?> | ||
--FILE-- | ||
<?php | ||
class Foo extends Bar { | ||
public function a() { print "Hello World!\n"; } | ||
} | ||
|
||
class Bar { | ||
public function b() { print "Hello World from Bar!\n"; } | ||
} | ||
|
||
|
||
$test = new Foo(); | ||
print($test->b()); | ||
runkit_import(dirname(__FILE__) . '/bug_4519_test.php', RUNKIT_IMPORT_OVERRIDE | RUNKIT_IMPORT_CLASSES); | ||
$test2 = new Foo(); | ||
print($test2->b()); | ||
?> | ||
--EXPECT-- | ||
Hello World from Bar! | ||
IMPORTED: Hello World from Bar! |
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,9 @@ | ||
<?php | ||
class Foo extends Bar { | ||
public function a() { print "IMPORTED: Hello World!\n"; } | ||
} | ||
|
||
class Bar { | ||
public function b() { print "IMPORTED: Hello World from Bar!\n"; } | ||
} | ||
?> |
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,22 @@ | ||
--TEST-- | ||
runkit_import() Importing and overriding functions | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit")) print "skip"; ?> | ||
--FILE-- | ||
<?php | ||
|
||
function foo() | ||
{ | ||
return "foo()\n"; | ||
} | ||
|
||
print(foo()); | ||
runkit_import(dirname(__FILE__) . '/runkit_import_functions_inc.php', RUNKIT_IMPORT_FUNCTIONS); | ||
print(foo()); | ||
runkit_import(dirname(__FILE__) . '/runkit_import_functions_inc.php', RUNKIT_IMPORT_OVERRIDE | RUNKIT_IMPORT_FUNCTIONS); | ||
print(foo()); | ||
?> | ||
--EXPECT-- | ||
foo() | ||
foo() | ||
IMPORTED: 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,8 @@ | ||
<?php | ||
|
||
function foo() | ||
{ | ||
return "IMPORTED: foo()\n"; | ||
} | ||
|
||
?> |