3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $var1 = 123; $var2 = '456A'; $var3 = 789; echo to_number($var1); echo to_number($var2); echo to_number($var3); # convert var to number function to_number($var) { return 0 + $var; }
Output for 7.1.0
123 Notice: A non well formed numeric value encountered in /in/LCJV1 on line 15 456789
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
123456789