/usr/share/php/tests/PHP_Compat/tests/function/array_product.phpt is in php-compat 1.6.0a3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | --TEST--
Function -- array_product
--FILE--
<?php
require_once 'PHP/Compat/Function/array_product.php';
function ehandler($no, $str)
{
echo '(Warning) ';
}
set_error_handler('ehandler');
$tests = array(
'foo',
array(),
array(0),
array(3),
array(3, 3),
array(0.5, 2, 3)
);
foreach ($tests as $v) {
echo "testing: (", (is_array($v) ? implode(' * ', $v) : $v), ")\n result: ";
var_dump(php_compat_array_product($v));
echo "\n\n";
}
restore_error_handler();
?>
--EXPECT--
testing: (foo)
result: (Warning) NULL
testing: ()
result: int(0)
testing: (0)
result: int(0)
testing: (3)
result: int(3)
testing: (3 * 3)
result: int(9)
testing: (0.5 * 2 * 3)
result: float(3)
|