3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $var1 = 123; $var2 = '456A'; $var3 = 789; echo to_number($var1) . "\n"; echo to_number($var2) . "\n"; echo to_number($var3) . "\n"; # convert var to number function to_number($var) { return 0 + $var; }
based on LCJV1
Output for 7.1.0
123 Notice: A non well formed numeric value encountered in /in/oEKPD on line 16 456 789
Output for 4.3.0 - 7.0.14
123 456 789