3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $on_fr = true; foreach (['dev', 'staging', 'production'] as $env) { if (! in_array($env, ['dev', 'staging']) || ! ($on_fr && $env === 'production')) { echo 'This environment is invalid ' . $env . PHP_EOL; } else { echo 'This environment is valid ' . $env . PHP_EOL; } }
based on rUAaT
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
This environment is invalid dev This environment is invalid staging This environment is invalid production