3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo 'boolean filter' . PHP_EOL; $on = filter_var('on', FILTER_VALIDATE_BOOLEAN); $true = filter_var('true', FILTER_VALIDATE_BOOLEAN); $one = filter_var('1', FILTER_VALIDATE_BOOLEAN); $ON = filter_var('ON', FILTER_VALIDATE_BOOLEAN); var_dump($on, $true, $one, $ON);
Output for 5.2.0 - 5.6.22, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
boolean filter bool(true) bool(true) bool(true) bool(true)
Output for 5.0.2 - 5.1.6
boolean filter Fatal error: Call to undefined function filter_var() in /in/DgMqQ on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/DgMqQ on line 3 boolean filterPHP_EOL Fatal error: Call to undefined function filter_var() in /in/DgMqQ on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
boolean filter Fatal error: Call to undefined function: filter_var() in /in/DgMqQ on line 4
Process exited with code 255.
Output for 4.3.10 - 4.4.4
boolean filter Fatal error: Call to undefined function: filter_var() in /in/DgMqQ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/DgMqQ on line 3 boolean filterPHP_EOL Fatal error: Call to undefined function: filter_var() in /in/DgMqQ on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/DgMqQ on line 3 boolean filterPHP_EOL Fatal error: Call to undefined function: filter_var() in /in/DgMqQ on line 4