mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
96f2f3174b
* The array "subject" of a function gets called $array. * Further parameters should be self-descriptive if used as a named parameter, and a full word, not an abbreviation. * If there is a "bunch more arrays" variadic, it gets called $arrays (because that's what was already there). * A few functions have a variadic "a bunch more arrays, and then a callable", and were already called $rest. I left those as is and died a little inside. * Any callable provided to an array function that acts on the array is called $callback. (Nearly all were already, I just fixed the one or two outliers.) * array_multisort() is beyond help so I ran screaming.
16 lines
440 B
PHP
16 lines
440 B
PHP
--TEST--
|
|
Bug #31720 (Invalid object callbacks not caught in array_walk())
|
|
--FILE--
|
|
<?php
|
|
$array = array('at least one element');
|
|
|
|
try {
|
|
array_walk($array, array($nonesuchvar,'show'));
|
|
} catch (TypeError $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Undefined variable $nonesuchvar in %s on line %d
|
|
array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object
|