mirror of
https://github.com/php/php-src.git
synced 2024-12-12 03:15:29 +08: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"
19 lines
372 B
PHP
19 lines
372 B
PHP
--TEST--
|
|
Bug #73663.2 ("Invalid opcode 65/16/8" occurs with a variable created with list())
|
|
--FILE--
|
|
<?php
|
|
function change(&$ref) {
|
|
$ref = range(1, 10);
|
|
return;
|
|
}
|
|
|
|
$array = [1];
|
|
change(list($val) = $array);
|
|
var_dump($array);
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|