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); var_dump($on, $true, $one, $ON); $false = filter_var('everythingElse', FILTER_VALIDATE_BOOLEAN); var_dump($false);
Output for 5.2.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
boolean filter: Notice: Undefined variable: ON in /in/mXhK7 on line 8 bool(true) bool(true) bool(true) NULL bool(false)
Output for hhvm-3.10.0
boolean filter: Notice: Undefined variable: ON in /in/mXhK7 on line 27 bool(true) bool(true) bool(true) NULL bool(false)
Output for 5.0.2 - 5.1.6
boolean filter: Fatal error: Call to undefined function filter_var() in /in/mXhK7 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/mXhK7 on line 3 boolean filter:PHP_EOL Fatal error: Call to undefined function filter_var() in /in/mXhK7 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/mXhK7 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/mXhK7 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/mXhK7 on line 3 boolean filter:PHP_EOL Fatal error: Call to undefined function: filter_var() in /in/mXhK7 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/mXhK7 on line 3 boolean filter:PHP_EOL Fatal error: Call to undefined function: filter_var() in /in/mXhK7 on line 4