octdec_basic.phpt 714 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --TEST--
  2. Test octdec() - basic function test octdec()
  3. --SKIPIF--
  4. <?php
  5. if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
  6. ?>
  7. --FILE--
  8. <?php
  9. $values = array(01234567,
  10. 0567,
  11. 017777777777,
  12. 020000000000,
  13. 0x1234ABC,
  14. 12345,
  15. '01234567',
  16. '0567',
  17. '017777777777',
  18. '020000000000',
  19. '0x1234ABC',
  20. '12345',
  21. 31101.3,
  22. 31.1013e5,
  23. true,
  24. false,
  25. null);
  26. for ($i = 0; $i < count($values); $i++) {
  27. $res = octdec($values[$i]);
  28. var_dump($res);
  29. }
  30. ?>
  31. --EXPECTF--
  32. int(14489)
  33. int(253)
  34. int(36947879)
  35. int(4618484)
  36. int(4104)
  37. int(5349)
  38. int(342391)
  39. int(375)
  40. int(2147483647)
  41. float(2147483648)
  42. int(668)
  43. int(5349)
  44. int(102923)
  45. int(823384)
  46. int(1)
  47. int(0)
  48. int(0)