3v4l.org

run code in 500+ PHP versions simultaneously
<?php $rate = 30; $total_amt = 200; $start_date = "19-08-2022"; $cost = $rate * 7; if($cost <= $total_amt){ echo "Remainder:".$total_amt - $cost; } else { echo "you need to pay extra:".$cost - $total_amt; }
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.6
you need to pay extra:10
Output for 7.4.0 - 7.4.33
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/EP8Et on line 8 Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/EP8Et on line 10 Warning: A non-numeric value encountered in /in/EP8Et on line 10 -200

preferences:
83.01 ms | 1261 KiB | 4 Q