decbin_basic.phpt 572 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Test decbin() - basic function test
  3. --FILE--
  4. <?php
  5. $values = array(10,
  6. 3950.5,
  7. 3.9505e3,
  8. 039,
  9. 0x5F,
  10. "10",
  11. "3950.5",
  12. "3.9505e3",
  13. "039",
  14. "0x5F",
  15. true,
  16. false,
  17. null,
  18. );
  19. for ($i = 0; $i < count($values); $i++) {
  20. $res = decbin($values[$i]);
  21. var_dump($res);
  22. }
  23. ?>
  24. --EXPECTF--
  25. string(4) "1010"
  26. string(12) "111101101110"
  27. string(12) "111101101110"
  28. string(2) "11"
  29. string(7) "1011111"
  30. string(4) "1010"
  31. string(12) "111101101110"
  32. string(2) "11"
  33. string(6) "100111"
  34. string(1) "0"
  35. string(1) "1"
  36. string(1) "0"
  37. string(1) "0"