3v4l.org

run code in 300+ PHP versions simultaneously
<?php function loancalc() { $result = '0.00'; /** testing **/ $_POST['submit'] = true; $_POST['principal'] = "7500.50"; $_POST['interest'] = "0.22"; $_POST['tenure'] = "7.7"; /** end testing **/ if( isset( $_POST['submit'] )){ // inspecting submitted values so that... foreach ($_POST as $key => $value) { $bool[$key] = ctype_print( $value ); } // ... if proven valid, then make assignments if ( $bool['principal'] && $bool['interest'] && $bool['tenure'] ) { [$principal, $interestRate,$tenure] = [$_POST['principal'], $_POST['interest'], $_POST['tenure']]; $result = $principal * $interestRate * $tenure; } echo number_format( $result,2,'.',',' ); // default English representation } // if posted ... }// end func loancalc();
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: ctype_print(): Argument of type bool will be interpreted as string in the future in /in/p2SSu on line 16 12,705.85

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.65 ms | 405 KiB | 5 Q