3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sumPrice = 5.00; $subTotal = 0.00; $voucherSum = sprintf('%01.2f', (sprintf('%01.2f',$sumPrice) - sprintf('%01.2f',$subtotal))); $parameter['has_voucher'] = (abs($voucherSum) >= 0.01) ? 1 : 0; var_dump($voucherSum); var_dump($parameter);
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: subtotal in /in/fvGPO on line 6 string(4) "5.00" array(1) { ["has_voucher"]=> int(1) }
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: subtotal in /in/fvGPO on line 6 string(4) "5.00" array(1) { ["has_voucher"]=> int(1) }