3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $name = 'admin'; $role = 'admin'; if ($name === 'admin') { return $role == 'admin'; } elseif ($name === 'editor') { return $role == 'admin' || $role == 'editor'; //editor is a child of admin } elseif ($name === 'user') { return $role == 'admin' || $role == 'editor' || $role == 'user' || $role == NULL; //user is a child of editor and admin, if we have no role defined this is also the default role } else { return false; } }
based on koAaJ
Output for 7.0.0
Parse error: syntax error, unexpected '}', expecting end of file in /in/U2YJQ on line 14
Process exited with code 255.
Output for 5.3.20 - 5.6.16
Parse error: syntax error, unexpected '}' in /in/U2YJQ on line 14
Process exited with code 255.