bug55797_1.phpt 590 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Bug #55797: Integer overflow in SdnToGregorian leads to segfault (in optimized builds)
  3. --EXTENSIONS--
  4. calendar
  5. --SKIPIF--
  6. <?php
  7. if (PHP_INT_SIZE != 4) {
  8. die("skip this test is for 32bit platform only");
  9. }
  10. ?>
  11. --FILE--
  12. <?php
  13. $x = 882858030;
  14. var_dump(cal_from_jd($x, CAL_GREGORIAN));
  15. ?>
  16. --EXPECTF--
  17. array(9) {
  18. ["date"]=>
  19. string(5) "0/0/0"
  20. ["month"]=>
  21. int(0)
  22. ["day"]=>
  23. int(0)
  24. ["year"]=>
  25. int(0)
  26. ["dow"]=>
  27. int(%d)
  28. ["abbrevdayname"]=>
  29. string(%d) "%s"
  30. ["dayname"]=>
  31. string(%d) "%s"
  32. ["abbrevmonth"]=>
  33. string(0) ""
  34. ["monthname"]=>
  35. string(0) ""
  36. }