3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump( json_decode(json_encode(10.0, JSON_PRESERVE_ZERO_FRACTION)) === 10.0 );
based on DKodl
Output for 5.6.6 - 7.2.0
bool(true)
Output for 5.4.0 - 5.6.5
Notice: Use of undefined constant JSON_PRESERVE_ZERO_FRACTION - assumed 'JSON_PRESERVE_ZERO_FRACTION' in /in/LcUCg on line 4 Warning: json_encode() expects parameter 2 to be long, string given in /in/LcUCg on line 4 bool(false)