3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function hex2bin($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('ijok'); echo hex2bin($encoded); ?>
based on FeoRB
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Fatal error: Cannot redeclare hex2bin() in /in/43gt0 on line 8
Process exited with code 255.
Output for hhvm-3.15.4

Process exited with code 139.