3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [1888.8861,1888.8851,1888.8841,1888.8881]; Foreach($arr as &$num){ $parts = str_split($num); If($parts[count($parts)-2]%2 ==0){ // Even $num = implode("",array_slice($parts,0,count($parts)-2)); }Else{ // Odd Echo $parts[count($parts)-3]+1; $num = implode("",array_slice($parts,0,count($parts)-3)).($parts[count($parts)-3]+1); } } Var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
9array(4) { [0]=> string(7) "1888.88" [1]=> string(7) "1888.89" [2]=> string(7) "1888.88" [3]=> &string(7) "1888.88" }

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:
126.15 ms | 405 KiB | 5 Q