Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug with inherited old-style constructors
we need some additional safechecks when redefining/adding these cursed old-style ctors
- Loading branch information
Showing
6 changed files
with
107 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
add old-style parent ctor | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
} | ||
|
||
class FOO_test extends test { | ||
} | ||
|
||
runkit_method_add("test", "test", "", "var_dump('new constructor');"); | ||
$a = new foo_test; | ||
|
||
echo "==DONE==\n"; | ||
?> | ||
--EXPECT-- | ||
string(15) "new constructor" | ||
==DONE== |
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-- | ||
add old-style parent ctor (existing ctor) | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
} | ||
|
||
class FOO_test extends test { | ||
function foo_test() { | ||
var_dump("foo_test ctor"); | ||
} | ||
} | ||
|
||
runkit_method_add("test", "test", "", "var_dump('new constructor');"); | ||
$a = new foo_test; | ||
|
||
echo "==DONE==\n"; | ||
?> | ||
--EXPECT-- | ||
string(13) "foo_test ctor" | ||
==DONE== |
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-- | ||
redefine old-style parent ctor | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
function test() { | ||
var_dump("original constructor"); | ||
} | ||
} | ||
|
||
class FOO_test extends test { | ||
} | ||
|
||
runkit_method_redefine("test", "test", "", "var_dump('new constructor');"); | ||
$a = new foo_test; | ||
|
||
echo "==DONE==\n"; | ||
?> | ||
--EXPECT-- | ||
string(15) "new constructor" | ||
==DONE== |