forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes phpGH-17151
- Loading branch information
Showing
5 changed files
with
95 additions
and
0 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,22 @@ | ||
--TEST-- | ||
GH-17151: ZEND_FETCH_OBJ_R may modify RC of op1 | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public function __get($name) { | ||
return $this; | ||
} | ||
} | ||
|
||
function test() { | ||
$x = (new C)->bar; | ||
var_dump($x); | ||
} | ||
|
||
test(); | ||
|
||
?> | ||
--EXPECTF-- | ||
object(C)#%d (0) { | ||
} |
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,29 @@ | ||
--TEST-- | ||
GH-17151: ZEND_FETCH_OBJ_R may modify RC of op1 | ||
--FILE-- | ||
<?php | ||
|
||
class C { | ||
public static $prop; | ||
|
||
public function __get($name) { | ||
C::$prop = null; | ||
} | ||
|
||
public function __destruct() { | ||
echo __METHOD__, "\n"; | ||
} | ||
} | ||
|
||
function test() { | ||
C::$prop = new C(); | ||
C::$prop->bar; | ||
} | ||
|
||
test(); | ||
echo "Done\n"; | ||
|
||
?> | ||
--EXPECT-- | ||
C::__destruct | ||
Done |