increment_001.phpt 668 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --TEST--
  2. incrementing different variables
  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. $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,
  24. (string)PHP_INT_MAX
  25. );
  26. foreach ($a as $var) {
  27. $var++;
  28. var_dump($var);
  29. }
  30. echo "Done\n";
  31. ?>
  32. --EXPECTF--
  33. array(3) {
  34. [0]=>
  35. int(1)
  36. [1]=>
  37. int(2)
  38. [2]=>
  39. int(3)
  40. }
  41. string(1) "1"
  42. int(2)
  43. float(3.5)
  44. int(1)
  45. string(6) "strinh"
  46. int(124)
  47. float(3.5)
  48. int(1)
  49. bool(true)
  50. bool(false)
  51. object(stdClass)#%d (0) {
  52. }
  53. array(0) {
  54. }
  55. float(2147483648)
  56. float(2147483648)
  57. Done