3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $num = "0xa"; $hexstr = sprintf("%x",( $num + 3)); // 0 $hexstr2 = sprintf("%s", hexdec($num) + 3 ); var_dump($hexstr,$hexstr2);
based on ZA0G0
Output for 7.1.0 - 7.2.0
Notice: A non well formed numeric value encountered in /in/C7Ch4 on line 4 string(1) "3" string(2) "13"
Output for 7.0.0 - 7.0.20
string(1) "3" string(2) "13"
Output for 5.3.19 - 5.6.28
string(1) "d" string(2) "13"