3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(substr($number, strrchr($number, '.') + 1)); die; $number = 12.4444; $decimal = strlen(substr($number, strpos($number, '.') + 1)); var_dump($decimal);
Output for 5.0.4 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined variable: number in /in/Z0jI4 on line 6 Notice: Undefined variable: number in /in/Z0jI4 on line 6 bool(false)
Output for hhvm-3.12.0
Notice: Undefined variable: number in /in/Z0jI4 on line 6 Notice: Undefined variable: number in /in/Z0jI4 on line 6 Warning: strrchr() expects parameter 1 to be string, null given in /in/Z0jI4 on line 6 Warning: substr() expects parameter 1 to be string, null given in /in/Z0jI4 on line 6 NULL
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: number in /in/Z0jI4 on line 6 Notice: Undefined variable: number in /in/Z0jI4 on line 6 bool(false)