decrement_001_64bit.phpt 900 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --TEST--
  2. decrementing different variables
  3. --SKIPIF--
  4. <?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
  5. --INI--
  6. precision=14
  7. --FILE--
  8. <?php
  9. $a = array(
  10. array(1,2,3),
  11. "",
  12. 1,
  13. 2.5,
  14. 0,
  15. "string",
  16. "123",
  17. "2.5",
  18. NULL,
  19. true,
  20. false,
  21. new stdclass,
  22. array(),
  23. -PHP_INT_MAX-1,
  24. (string)(-PHP_INT_MAX-1),
  25. );
  26. foreach ($a as $var) {
  27. try {
  28. $var--;
  29. } catch (TypeError $e) {
  30. echo $e->getMessage(), "\n";
  31. }
  32. var_dump($var);
  33. }
  34. echo "Done\n";
  35. ?>
  36. --EXPECT--
  37. Cannot decrement array
  38. array(3) {
  39. [0]=>
  40. int(1)
  41. [1]=>
  42. int(2)
  43. [2]=>
  44. int(3)
  45. }
  46. int(-1)
  47. int(0)
  48. float(1.5)
  49. int(-1)
  50. string(6) "string"
  51. int(122)
  52. float(1.5)
  53. NULL
  54. bool(true)
  55. bool(false)
  56. Cannot decrement stdClass
  57. object(stdClass)#1 (0) {
  58. }
  59. Cannot decrement array
  60. array(0) {
  61. }
  62. float(-9.223372036854776E+18)
  63. float(-9.223372036854776E+18)
  64. Done