mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Added test for (long-ago fixed) bug #70083
This commit is contained in:
parent
897bf916bc
commit
3e3d0290ff
26
Zend/tests/bug70083.phpt
Normal file
26
Zend/tests/bug70083.phpt
Normal file
@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #70083 (Use after free with assign by ref to overloaded objects)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class foo {
|
||||
private $var;
|
||||
function __get($e) {
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
function &noref() { $foo = 1; return $foo; }
|
||||
|
||||
$foo = new foo;
|
||||
$foo->i = &noref();
|
||||
var_dump($foo);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
|
Loading…
Reference in New Issue
Block a user