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.
fixed importing of existing static properties, new test was added
- Loading branch information
Showing
6 changed files
with
69 additions
and
58 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,45 @@ | ||
--TEST-- | ||
runkit_default_property_add() function for existing static properties | ||
--SKIPIF-- | ||
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_MANIPULATION) print "skip"; | ||
if(array_shift(explode('.', PHP_VERSION)) < 5) print "skip"; | ||
?> | ||
--INI-- | ||
error_reporting=E_ALL | ||
display_errors=on | ||
--FILE-- | ||
<?php | ||
class RunkitParent { | ||
} | ||
|
||
class RunkitClass extends RunkitParent { | ||
public static $oldProperty = 'old'; | ||
} | ||
|
||
class RunkitSubClass extends RunkitClass { | ||
} | ||
|
||
runkit_default_property_add('RunkitClass', 'oldProperty', array('a'=>1), RUNKIT_ACC_STATIC); | ||
var_dump(RunkitClass::$oldProperty); | ||
runkit_default_property_add('RunkitSubClass', 'oldProperty', array('a'=>1), RUNKIT_ACC_STATIC); | ||
var_dump(RunkitSubClass::$oldProperty); | ||
runkit_default_property_add('RunkitParent', 'oldProperty', array('a'=>1), RUNKIT_ACC_STATIC); | ||
var_dump(RunkitParent::$oldProperty); | ||
var_dump(RunkitClass::$oldProperty); | ||
var_dump(RunkitSubClass::$oldProperty); | ||
?> | ||
--EXPECTF-- | ||
|
||
Warning: runkit_default_property_add(): RunkitClass::$oldProperty already exists in %s on line %d | ||
string(3) "old" | ||
|
||
Warning: runkit_default_property_add(): RunkitSubClass::$oldProperty already exists in %s on line %d | ||
string(3) "old" | ||
|
||
Notice: runkit_default_property_add(): RunkitClass::$oldProperty already exists, not adding in %s on line %d | ||
array(1) { | ||
["a"]=> | ||
int(1) | ||
} | ||
string(3) "old" | ||
string(3) "old" |