/hphp/test/slow/chr-invalid-type.php

http://github.com/facebook/hiphop-php · PHP · 19 lines · 16 code · 3 blank · 0 comment · 0 complexity · 95653749f36c699de8014be369fd7894 MD5 · raw file

  1. <?hh
  2. <<__EntryPoint>>
  3. function main_chr_invalid_type() {
  4. $inputs = varray[
  5. -1, 0, 1, 2, 128, 255,
  6. "0string", "1string", "2",
  7. varray[], varray[1], varray[1,2],
  8. new stdClass,
  9. new SimpleXMLElement("<foo />"),
  10. new SimpleXMLElement("<foo><bar/></foo>"),
  11. fopen(__FILE__, 'r'),
  12. ];
  13. foreach ($inputs as $v) {
  14. var_dump(bin2hex(chr($v)));
  15. }
  16. }