php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay
files >> /php-7.1.11/ext/standard/tests/array/ |
files >> //php-7.1.11/ext/standard/tests/array/array_reduce_variation1.phpt |
--TEST-- Test array_reduce() function : variation --FILE-- <?php /* Prototype : mixed array_reduce(array input, mixed callback [, int initial]) * Description: Iteratively reduce the array to a single value via the callback. * Source code: ext/standard/array.c * Alias to functions: */ echo "*** Testing array_reduce() : variation ***\n"; function oneArg($v) { return $v; } function threeArgs($v, $w, $x) { return $v + $w + $x; } $array = array(1); echo "\n--- Testing with a callback with too few parameters ---\n"; var_dump(array_reduce($array, "oneArg", 2)); echo "\n--- Testing with a callback with too many parameters ---\n"; try { var_dump(array_reduce($array, "threeArgs", 2)); } catch (Throwable $e) { echo "Exception: " . $e->getMessage() . "\n"; } ?> ===DONE=== --EXPECTF-- *** Testing array_reduce() : variation *** --- Testing with a callback with too few parameters --- int(2) --- Testing with a callback with too many parameters --- Exception: Too few arguments to function threeArgs(), 2 passed and exactly 3 expected ===DONE===y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`