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 ? 'Yes' : 'No') . PHP_EOL; } else { echo 'This environment is valid ' . $env . ' ' . ($on_fr ? 'Yes' : 'No') . PHP_EOL; } } }
based on 9vvtm
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
This environment is valid dev Yes This environment is valid dev No This environment is valid staging Yes This environment is valid staging No This environment is invalid regcheck Yes This environment is invalid regcheck No This environment is valid production Yes This environment is invalid production No