3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = array( 20/3, 20/3 * 1e6, 6.66, 6.0, 60.0, ); $p = (int) ini_get('precision'); foreach ($numbers as $n) { echo 'RAW: ' . $n . "\n"; echo 'EXP: ' . var_export($n, TRUE) . "\n"; echo 'FIX: ' . rtrim(rtrim(sprintf('%.' . ($p - ceil(log10($n))) . 'F', $n), '0'), '.') . "\n"; echo "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
RAW: 6.6666666666667 EXP: 6.666666666666667 FIX: 6.6666666666667 RAW: 6666666.6666667 EXP: 6666666.666666667 FIX: 6666666.6666667 RAW: 6.66 EXP: 6.66 FIX: 6.66 RAW: 6 EXP: 6.0 FIX: 6 RAW: 60 EXP: 60.0 FIX: 60

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
52.62 ms | 401 KiB | 8 Q