Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug #45178 (memory corruption on assignment result of "new" by …
…reference)
- Loading branch information
Showing
7 changed files
with
66 additions
and
1 deletion.
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,29 @@ | ||
--TEST-- | ||
Bug #45178 memory corruption on assignment result of "new" by reference | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
function __construct() { | ||
$this->error = array($this,$this); | ||
} | ||
} | ||
$a =& new Foo(); | ||
|
||
class Bar { | ||
function __construct() { | ||
$this->_rme2 = $this; | ||
} | ||
} | ||
|
||
$b =& new Bar(); | ||
$b->_rme2 = 0; | ||
var_dump($b); | ||
?> | ||
--EXPECTF-- | ||
Strict Standards: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 7 | ||
|
||
Strict Standards: Assigning the return value of new by reference is deprecated in %sbug45178.php on line 15 | ||
object(Bar)#%d (1) { | ||
["_rme2"]=> | ||
int(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
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