3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale(LC_MONETARY, 'en_US'); $deal = array( array( 'amt' => 1350, 'rate' => .75, 'lod' => 47 ), array( 'amt' => 990, 'rate' => .75, 'lod' => 27 ), array( 'amt' => 4180, 'rate' => .75, 'lod' => 65 ), array( 'amt' => 2370, 'rate' => .75, 'lod' => 26 ) ); bcscale(4); foreach ($deal as $value) { $fee = bcmul(bcmul(bcdiv($value['amt'], 1000), $value['rate']), $value['lod']); var_dump($fee); echo 'money_format: ' . money_format('%.2n', $fee) . \PHP_EOL; echo 'number_format: ' . number_format($fee, 2); echo \PHP_EOL . \PHP_EOL; }
Output for git.master_jit, git.master, rfc.property-hooks
string(7) "47.5875" Fatal error: Uncaught Error: Call to undefined function money_format() in /in/JEZds:30 Stack trace: #0 {main} thrown in /in/JEZds on line 30
Process exited with code 255.

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