3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('precision', 19); ini_set('serialize_precision', 19); $int = '0'; $z5 = $int . '.5'; $float = 2.5; $float = 0.49999999999999994; //$float = 0.156; //$float = 0.00000000000000001; //$float = 4503599627370495.5; //$float = 9007199254740991.0; //$float = 2.0; $copy = $float; $flstr = '+' . $copy . ''; $sign = trim($flstr, '.,0123456789'); $sign = strtr($sign, array('+' => '')); $int = (int) $float; $z5 = $int . '.5'; $tmp_value = $float; if($float > 0.0) { $nrnd1 = $float + 0.5; $nrnd2 = $float - 0.5; $rrnd = $nrnd2 + 0.5; if($rrnd == $float && $nrnd2 != $float) { $tmp_value = $nrnd1; } else { echo 'No'; } } else { $nrnd1 = 0.5 - $float; if(0.5 - $nrnd1 == $float) { $tmp_value = $float - 0.5; } } $zn = -0.1 * 0.0; var_dump($nrnd2, $tmp_value, -0.0 - 0.5, $float - 0.5); //ini_set('serialize_precision', 2); var_dump($float, 0.5 - $float, $float - 0.5, round($float));
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
float(-5.551115123125782702E-17) float(1) float(-0.5) float(-5.551115123125782702E-17) float(0.4999999999999999445) float(5.551115123125782702E-17) float(-5.551115123125782702E-17) float(1)

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:
96.14 ms | 407 KiB | 5 Q