forked from php/php-src
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make implicit isset/unset inherit get/set modifiers
Closes issue php#39
- Loading branch information
Showing
3 changed files
with
69 additions
and
3 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
59 changes: 59 additions & 0 deletions
59
Zend/tests/accessors/isset_unset_inherit_get_set_modifiers.phpt
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,59 @@ | ||
--TEST-- | ||
Isset/unset inherit get/set visibility | ||
--FILE-- | ||
<?php | ||
|
||
abstract class Test { | ||
public $foo { | ||
protected get; | ||
private set; | ||
} | ||
public $bar { | ||
abstract get; | ||
final set; | ||
} | ||
} | ||
|
||
echo new ReflectionProperty('Test', 'foo'); | ||
echo new ReflectionProperty('Test', 'bar'); | ||
|
||
?> | ||
--EXPECTF-- | ||
Accessor [ public $foo ] { | ||
Method [ <user> protected method $foo->get ] { | ||
@@ %s %d - %d | ||
} | ||
Method [ <user> private method $foo->set ] { | ||
@@ %s %d - %d | ||
|
||
- Parameters [1] { | ||
Parameter #0 [ <required> $value ] | ||
} | ||
} | ||
Method [ <user> protected method $foo->isset ] { | ||
@@ %s %d - %d | ||
} | ||
Method [ <user> private method $foo->unset ] { | ||
@@ %s %d - %d | ||
} | ||
} | ||
] | ||
Accessor [ public $bar ] { | ||
Method [ <user> abstract public method $bar->get ] { | ||
@@ %s %d - %d | ||
} | ||
Method [ <user> final public method $bar->set ] { | ||
@@ %s %d - %d | ||
|
||
- Parameters [1] { | ||
Parameter #0 [ <required> $value ] | ||
} | ||
} | ||
Method [ <user> abstract public method $bar->isset ] { | ||
@@ %s %d - %d | ||
} | ||
Method [ <user> final public method $bar->unset ] { | ||
@@ %s %d - %d | ||
} | ||
} | ||
] |
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