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('ONb', FILTER_VALIDATE_BOOLEAN); var_dump($on, $true, $one, $ON);
Output for 5.2.0 - 7.1.0
boolean filter: bool(true) bool(true) bool(true) bool(false)
Output for 5.0.2 - 5.1.6
boolean filter: <br /> <b>Fatal error</b>: Call to undefined function filter_var() in <b>/in/Nib6s</b> on line <b>4</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.1
boolean filter:PHP_EOL<br /> <b>Fatal error</b>: Call to undefined function filter_var() in <b>/in/Nib6s</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
boolean filter: <br /> <b>Fatal error</b>: Call to undefined function: filter_var() in <b>/in/Nib6s</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.10 - 4.4.4
boolean filter: <br /> <b>Fatal error</b>: Call to undefined function: filter_var() in <b>/in/Nib6s</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.9
boolean filter:PHP_EOL<br /> <b>Fatal error</b>: Call to undefined function: filter_var() in <b>/in/Nib6s</b> on line <b>4</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
boolean filter:PHP_EOL<br /> <b>Fatal error</b>: Call to undefined function: filter_var() in <b>/in/Nib6s</b> on line <b>4</b><br />