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"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 3
Branch analysis from position: 13
Branch analysis from position: 3
filename:       /in/NpPUX
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CONST                                            'response_codes', <array>
   21     1        ASSIGN                                                   !0, 0
          2      > JMP                                                      ->11
   22     3    >   INIT_FCALL                                               'var_export'
          4        INIT_FCALL                                               'interpretresponse'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   23     9        ECHO                                                     '%0A'
   21    10        PRE_INC                                                  !0
         11    >   IS_SMALLER                                               !0, 6
         12      > JMPNZ                                                    ~5, ->3
   24    13    > > RETURN                                                   1

Function interpretresponse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NpPUX
function name:  interpretResponse
number of ops:  7
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        FETCH_CONSTANT                                   ~1      'response_codes'
          2        FETCH_DIM_IS                                     ~2      ~1, !0
          3        COALESCE                                         ~3      ~2
          4        QM_ASSIGN                                        ~3      <array>
          5      > RETURN                                                   ~3
   19     6*     > RETURN                                                   null

End of function interpretresponse

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.5 ms | 1398 KiB | 16 Q