3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $amt = '$1.5'; $amt = $amount * (substr(amt, 0, (strlen($amt)-1) ) / 100); $amt = round($amt, 2, PHP_ROUND_HALF_UP); echo (float)$amt;
based on 0iEUK
Output for 7.2.0
Warning: Use of undefined constant amt - assumed 'amt' (this will throw an Error in a future version of PHP) in /in/7bTAq on line 5 Warning: A non-numeric value encountered in /in/7bTAq on line 5 Notice: Undefined variable: amount in /in/7bTAq on line 5 0
Output for 7.1.0 - 7.1.10
Notice: Use of undefined constant amt - assumed 'amt' in /in/7bTAq on line 5 Warning: A non-numeric value encountered in /in/7bTAq on line 5 Notice: Undefined variable: amount in /in/7bTAq on line 5 0
Output for 5.3.20 - 7.0.20
Notice: Use of undefined constant amt - assumed 'amt' in /in/7bTAq on line 5 Notice: Undefined variable: amount in /in/7bTAq on line 5 0