/hphp/test/slow/chr-invalid-type.php
PHP | 19 lines | 16 code | 3 blank | 0 comment | 0 complexity | 95653749f36c699de8014be369fd7894 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- <<__EntryPoint>>
- function main_chr_invalid_type() {
- $inputs = varray[
- -1, 0, 1, 2, 128, 255,
- "0string", "1string", "2",
- varray[], varray[1], varray[1,2],
- new stdClass,
- new SimpleXMLElement("<foo />"),
- new SimpleXMLElement("<foo><bar/></foo>"),
- fopen(__FILE__, 'r'),
- ];
- foreach ($inputs as $v) {
- var_dump(bin2hex(chr($v)));
- }
- }