php-src/Zend/tests/bug78154.phpt
Dmitry Stogov 64b40f69dc Make ASSIGN, ASSIGN_OP, INC and DEC opcodes to return IS_TMP_VAR instead of IS_VAR.
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"
2020-02-07 13:36:52 +03:00

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