3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $net_pay = 8345.24; $net_pay = trim($emp->net_pay, ' '); $net_pay = mb_substr($net_pay, 0, 11); $net_pay = str_replace(',', '', $net_pay); $net_pay = number_format($net_pay); $h = str_pad($net_pay, 11, $extraVal, STR_PAD_LEFT); print $h;
Output for 7.2.0
Notice: Undefined variable: emp in /in/jFl5u on line 6 Notice: Trying to get property 'net_pay' of non-object in /in/jFl5u on line 6 Warning: number_format() expects parameter 1 to be float, string given in /in/jFl5u on line 9 Notice: Undefined variable: extraVal in /in/jFl5u on line 10 Warning: str_pad(): Padding string cannot be empty in /in/jFl5u on line 10
Output for 7.0.0 - 7.1.10
Notice: Undefined variable: emp in /in/jFl5u on line 6 Notice: Trying to get property of non-object in /in/jFl5u on line 6 Warning: number_format() expects parameter 1 to be float, string given in /in/jFl5u on line 9 Notice: Undefined variable: extraVal in /in/jFl5u on line 10 Warning: str_pad(): Padding string cannot be empty in /in/jFl5u on line 10
Output for 5.3.21 - 5.6.28
Notice: Undefined variable: emp in /in/jFl5u on line 6 Notice: Trying to get property of non-object in /in/jFl5u on line 6 Warning: number_format() expects parameter 1 to be double, string given in /in/jFl5u on line 9 Notice: Undefined variable: extraVal in /in/jFl5u on line 10 Warning: str_pad(): Padding string cannot be empty in /in/jFl5u on line 10