bug35014.phpt 660 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #35014 (array_product() always returns 0) (32bit)
  3. --SKIPIF--
  4. <?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
  5. --INI--
  6. precision=14
  7. --FILE--
  8. <?php
  9. $tests = array(
  10. 'foo',
  11. array(),
  12. array(0),
  13. array(3),
  14. array(3, 3),
  15. array(0.5, 2),
  16. array(99999999, 99999999),
  17. array(8.993, 7443241,988, sprintf("%u", -1)+0.44),
  18. array(2,sprintf("%u", -1)),
  19. );
  20. foreach ($tests as $v) {
  21. var_dump(array_product($v));
  22. }
  23. ?>
  24. --EXPECTF--
  25. Warning: array_product() expects parameter 1 to be array, string given in %s on line %d
  26. NULL
  27. int(1)
  28. int(0)
  29. int(3)
  30. int(9)
  31. float(1)
  32. float(9.9999998E+15)
  33. float(2.8404260053903E+20)
  34. float(8589934590)