3v4l.org

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