3v4l.org

run code in 300+ PHP versions simultaneously
<?php $valorNominal = '45750'; $posVirgula = ""; if(strpos($valorNominal, '.') > -1){ $posVirgula = substr( $valorNominal, strlen($valorNominal)-2, strlen($valorNominal) ); if(strpos($posVirgula, '.') > -1){ $posVirgula = str_replace(".", "", $posVirgula); $posVirgula .= '0'; } } else { $posVirgula = "00"; } $valorNominal = substr( $valorNominal, 0, strlen($valorNominal)-2 ); echo $valorNominal; die; $valorNominal = number_format((double)$valorNominal, 2, ',', '.'); $valorNominal = explode(',', $valorNominal); $valorNominal = $valorNominal[0].','.$posVirgula; echo $valorNominal;
Output for git.master, git.master_jit, rfc.property-hooks
457

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:
72.48 ms | 401 KiB | 8 Q