mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
01453a0af7
Even though the input is not a reference (or not treated as such), we still need to create a reference to satisfy the function signature. Various code relies on reference arguments actually being references. In this particular case, it would result in a JIT crash. The zend_call_function() implementation already handled this correctly.
18 lines
391 B
PHP
18 lines
391 B
PHP
--TEST--
|
|
call_user_func() with ref arg and type check
|
|
--FILE--
|
|
<?php
|
|
|
|
function test(Type &$ref) {
|
|
}
|
|
try {
|
|
call_user_func('test', 0);
|
|
} catch (TypeError $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: test(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
|
|
test(): Argument #1 ($ref) must be of type Type, int given, called in %s on line %d
|