3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo filter_var('$42.342', FILTER_SANITIZE_NUMBER);
based on ApFHE
Output for 7.2.0
Warning: Use of undefined constant FILTER_SANITIZE_NUMBER - assumed 'FILTER_SANITIZE_NUMBER' (this will throw an Error in a future version of PHP) in /in/tcuj2 on line 2 Warning: filter_var() expects parameter 2 to be integer, string given in /in/tcuj2 on line 2
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant FILTER_SANITIZE_NUMBER - assumed 'FILTER_SANITIZE_NUMBER' in /in/tcuj2 on line 2 Warning: filter_var() expects parameter 2 to be integer, string given in /in/tcuj2 on line 2
Output for 5.3.19 - 5.6.28
Notice: Use of undefined constant FILTER_SANITIZE_NUMBER - assumed 'FILTER_SANITIZE_NUMBER' in /in/tcuj2 on line 2 Warning: filter_var() expects parameter 2 to be long, string given in /in/tcuj2 on line 2