3v4l.org

run code in 300+ PHP versions simultaneously
<?php function XXhex2bin($h) { if (!is_string($h)) return null; $r=''; for ($a=0; $a<strlen($h); $a+=2) { $r.=chr(hexdec($h{$a}.$h{($a+1)})); } return $r; } $encoded = bin2hex("''"); echo hex2bin($encoded); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/Yq37R on line 6
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/Yq37R on line 6 Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/Yq37R on line 6 ''
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33
''

preferences:
131.85 ms | 402 KiB | 169 Q