3v4l.org

run code in 200+ 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 - 7.2.0
123 Notice: A non well formed numeric value encountered in /in/LCJV1 on line 15 456789
Output for 4.3.0 - 7.0.20
123456789