mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
64b40f69dc
This helps to avoid unnecessary IS_REFERENCE checks. This changes some notices "Only variables should be passed by reference" to exception "Cannot pass parameter %d by reference". Also, for consistency, compile-time fatal error "Only variables can be passed by reference" was converted to exception "Cannot pass parameter %d by reference"
27 lines
530 B
PHP
27 lines
530 B
PHP
--TEST--
|
|
Bug #78154: SEND_VAR_NO_REF does not always send reference
|
|
--FILE--
|
|
<?php
|
|
|
|
namespace {
|
|
try {
|
|
var_dump(similar_text('a', 'a', $c=0x44444444));
|
|
var_dump($c);
|
|
} catch (Throwable $e) {
|
|
echo "Exception: " . $e->getMessage() . "\n";
|
|
}
|
|
}
|
|
namespace Foo {
|
|
try {
|
|
var_dump(similar_text('a', 'a', $d=0x44444444));
|
|
var_dump($d);
|
|
} catch (\Throwable $e) {
|
|
echo "Exception: " . $e->getMessage() . "\n";
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Exception: Cannot pass parameter 3 by reference
|
|
Exception: Cannot pass parameter 3 by reference
|