mirror of
https://github.com/php/php-src.git
synced 2024-09-24 03:17: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"
19 lines
258 B
PHP
19 lines
258 B
PHP
--TEST--
|
|
Attempt to pass a constant by reference
|
|
--FILE--
|
|
<?php
|
|
|
|
function f(&$arg1)
|
|
{
|
|
var_dump($arg1++);
|
|
}
|
|
|
|
f(2);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|