mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
31 lines
563 B
PHP
31 lines
563 B
PHP
--TEST--
|
|
Bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
test($foo = new stdClass);
|
|
var_dump($foo);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
try {
|
|
test($bar = 2);
|
|
var_dump($bar);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage() . "\n";
|
|
}
|
|
|
|
test($baz = &$bar);
|
|
var_dump($baz);
|
|
|
|
function test(&$param) {
|
|
$param = 1;
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
test(): Argument #1 ($param) could not be passed by reference
|
|
test(): Argument #1 ($param) could not be passed by reference
|
|
int(1)
|