php-src/Zend/tests/call_user_func_009.phpt
Tyson Andre 1e9a5c67ef Rename standard array function parameters to $array
This is targeting 8.0.

`$arg` seems like a poor choice of a name,
especially if the function were to have arguments added.

In many cases, the php.net documentation already has $array for these functions.
E.g. https://www.php.net/manual/en/function.array-intersect.php

I'd assume that since named arguments was added to 8.0 near the feature freeze,
PHP's maintainers had planned to make the names consistent
and gradually use the same name for  docs and implementation.
2020-08-11 19:11:59 -04:00

18 lines
419 B
PHP

--TEST--
call_user_func() behavior when passing literal to reference parameter
--FILE--
<?php
namespace Foo;
var_dump(call_user_func('sort', []));
var_dump(\call_user_func('sort', []));
?>
--EXPECTF--
Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d
bool(true)
Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d
bool(true)