3v4l.org

run code in 300+ PHP versions simultaneously
<?php const response_codes = [ ["Usuario incorrecto.", false], ["Password incorrecta.", false], ["Credenciales inválidas.", false], ["Logueado correctamente.", true], ["No se pudo conectar al servidor LDAP para validar las credenciales.", false] ]; /** * Looks up response id in response codes and return the appropriate message * * @param [int] $responseId - the id of the response. * @return array(string, bool) the response message and false if it is an error or true if it a success. */ function interpretResponse($id) { return response_codes[$id] ?? ["Error desconocido", false]; } for ($x = 0; $x < 6; ++$x) { var_export(interpretResponse($x)); echo "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'Usuario incorrecto.', 1 => false, ) array ( 0 => 'Password incorrecta.', 1 => false, ) array ( 0 => 'Credenciales inválidas.', 1 => false, ) array ( 0 => 'Logueado correctamente.', 1 => true, ) array ( 0 => 'No se pudo conectar al servidor LDAP para validar las credenciales.', 1 => false, ) array ( 0 => 'Error desconocido', 1 => false, )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.07 ms | 402 KiB | 8 Q