Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I thought these SEPARATE_ZVAL_IF_NOT_REF usages were safe at first, because incdec op supports reference variables. However this violates the constraint that IS_TMP_VAR variables may not be references (which is an issue if you use the result of the incdec op). Still need to fix the cases where read_property/write_property is used.
- Loading branch information
Showing
4 changed files
with
94 additions
and
67 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,27 @@ | ||
--TEST-- | ||
Incrementing and decrementing a referenced property | ||
--FILE-- | ||
<?php | ||
|
||
$obj = new stdClass; | ||
$obj->prop = 1; | ||
$ref =& $obj->prop; | ||
var_dump(++$obj->prop); | ||
var_dump($obj->prop); | ||
var_dump($obj->prop++); | ||
var_dump($obj->prop); | ||
var_dump(--$obj->prop); | ||
var_dump($obj->prop); | ||
var_dump($obj->prop--); | ||
var_dump($obj->prop); | ||
|
||
?> | ||
--EXPECT-- | ||
int(2) | ||
int(2) | ||
int(2) | ||
int(3) | ||
int(2) | ||
int(2) | ||
int(2) | ||
int(1) |
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