3v4l.org

run code in 300+ PHP versions simultaneously
<?php $h = '0032003000310038002d00300031002d00300031'; $s_be = hex2bin($h); var_dump($s_be); $s = mb_convert_encoding($s_be, 'UTF-8', 'UTF-16BE'); var_dump($s);
based on KYGIZ
Output for 7.3.0 - 7.3.26, 7.4.0 - 7.4.14, 8.0.0 - 8.0.1
string(20) "2018-01-01" string(10) "2018-01-01"