3v4l.org

run code in 300+ PHP versions simultaneously
<?php function roundRating($rating) { if($rating>=5 && $rating<0){ $rating=0; } $a=(int)$rating/1; $b= sprintf('%3f',$rating-$a); if(($b>=.1) && ($b<=.2)){ $b=0; $rating=$a; } elseif(($b>=.3 && $b<=.4)|| ($b>=.6 && $b<=.7)){ $b=.5; $rating=$a+$b; } elseif(($b>=.8) && ($b<=.9)){ $b=1; $rating=$a+$b; $a=$rating; } else{} return $rating; } echo roundRating(3.3);
Output for git.master, git.master_jit, rfc.property-hooks
3.5

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