mirror of
https://github.com/php/php-src.git
synced 2024-12-01 05:43:38 +08:00
8d00385871
Per RFC https://wiki.php.net/rfc/reclassify_e_strict While reviewing this, found that there are still three E_STRICTs left in libraries - need to discuss those.
30 lines
516 B
PHP
30 lines
516 B
PHP
--TEST--
|
|
Returning a reference from a function.
|
|
--FILE--
|
|
<?php
|
|
function &returnRef() {
|
|
global $a;
|
|
return $a;
|
|
}
|
|
|
|
function returnVal() {
|
|
global $a;
|
|
return $a;
|
|
}
|
|
|
|
$a = "original";
|
|
$b =& returnVal();
|
|
$b = "changed";
|
|
var_dump($a); //expecting warning + "original"
|
|
|
|
$a = "original";
|
|
$b =& returnRef();
|
|
$b = "changed";
|
|
var_dump($a); //expecting "changed"
|
|
?>
|
|
--EXPECTF--
|
|
|
|
Notice: Only variables should be assigned by reference in %s on line 13
|
|
string(8) "original"
|
|
string(7) "changed"
|