forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed zend_accessor_info to be a member of zend_property_info rather
than it's own set of hash pairs. This greatly simplified things and eliminated a hash lookup for every property access. Also reduced memory footprint as a separate copy of doc_comments did not need to be maintained. Fixed php#11
- Loading branch information
cpriest
committed
Jan 2, 2013
1 parent
64699ee
commit b04e5b0
Showing
16 changed files
with
440 additions
and
493 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
21 changes: 8 additions & 13 deletions
21
Zend/tests/accessors/accessor_object_get_autoimplement_basic.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 |
---|---|---|
@@ -1,30 +1,25 @@ | ||
--TEST-- | ||
ZE2 Tests that an auto-implemented getter has a protected auto-implemented variable defined and that it can be retrieved through the accessor | ||
ZE2 Tests that an auto-implemented getter has an auto-implemented variable defined and that it can be retrieved through the accessor | ||
--FILE-- | ||
<?php | ||
|
||
class AccessorTest { | ||
public $b { | ||
get; | ||
} | ||
|
||
public function __construct() { | ||
$this->__b = 5; | ||
} | ||
} | ||
|
||
$o = new AccessorTest(); | ||
|
||
$rf = new ReflectionClass($o); | ||
foreach($rf->getProperties(ReflectionProperty::IS_PROTECTED) as $rfp) { | ||
if($rfp->getName() == '__b') | ||
echo "Protected property: \$".$rfp->getName()." exists.\n"; | ||
} | ||
var_dump($o); | ||
|
||
echo "\$o->b: ".$o->b."\n"; | ||
echo "Done\n"; | ||
?> | ||
--EXPECTF-- | ||
Protected property: $__b exists. | ||
$o->b: 5 | ||
Done | ||
object(AccessorTest)#1 (1) { | ||
["b"]=> | ||
NULL | ||
} | ||
$o->b: | ||
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
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
14 changes: 14 additions & 0 deletions
14
Zend/tests/accessors/duplicate_property_declared_error.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,14 @@ | ||
--TEST-- | ||
ZE2 Tests that an accessor cannot be declared if a property is already declared | ||
--FILE-- | ||
<?php | ||
|
||
class TimePeriod { | ||
public $Seconds; | ||
public $Seconds { | ||
} | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot redeclare TimePeriod::$Seconds in %s on line %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
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
Oops, something went wrong.