mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
e080fb6d92
Make behavior consistent with a loop of normal assignments. This is not a big issue now, because $this is the only case that may generate an error. However typed references introduce additional error conditions, which would be silenced by this kind of behavior.
20 lines
306 B
PHP
20 lines
306 B
PHP
--TEST--
|
|
$this re-assign in extract()
|
|
--FILE--
|
|
<?php
|
|
function foo() {
|
|
try {
|
|
extract(["this"=>42, "a"=>24]);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
var_dump($a);
|
|
}
|
|
foo();
|
|
?>
|
|
--EXPECTF--
|
|
Cannot re-assign $this
|
|
|
|
Notice: Undefined variable: a in %s on line %d
|
|
NULL
|