max.phpt 823 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. max() tests
  3. --INI--
  4. precision=14
  5. --FILE--
  6. <?php
  7. var_dump(max());
  8. var_dump(max(1));
  9. var_dump(max(array()));
  10. var_dump(max(new stdclass));
  11. var_dump(max(2,1,2));
  12. var_dump(max(2.1,2.11,2.09));
  13. var_dump(max("", "t", "b"));
  14. var_dump(max(false, true, false));
  15. var_dump(max(true, false, true));
  16. var_dump(max(1, true, false, true));
  17. var_dump(max(0, true, false, true));
  18. echo "Done\n";
  19. ?>
  20. --EXPECTF--
  21. Warning: max() expects at least 1 parameter, 0 given in %s on line 3
  22. NULL
  23. Warning: max(): When only one parameter is given, it must be an array in %s on line 4
  24. NULL
  25. Warning: max(): Array must contain at least one element in %s on line 5
  26. bool(false)
  27. Warning: max(): When only one parameter is given, it must be an array in %s on line 6
  28. NULL
  29. int(2)
  30. float(2.11)
  31. string(1) "t"
  32. bool(true)
  33. bool(true)
  34. int(1)
  35. bool(true)
  36. Done