3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(array_map(function($token) { $token[0] = token_name($token[0]); return $token; }, token_get_all("<?php if (0 === 1) {} elseif (1 === 2) {} else {}"))); var_dump(array_map(function($token) { $token[0] = token_name($token[0]); return $token; }, token_get_all("<?php if (0 === 1) {} else if (1 === 2) {} else {}")));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aassj
function name:  (null)
number of ops:  23
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Faassj%3A3%240'
    7     3        SEND_VAL                                                 ~0
          4        INIT_FCALL                                               'token_get_all'
          5        SEND_VAL                                                 '%3C%3Fphp+if+%280+%3D%3D%3D+1%29+%7B%7D+elseif+%281+%3D%3D%3D+2%29+%7B%7D+else+%7B%7D'
          6        DO_ICALL                                         $1      
          7        SEND_VAR                                                 $1
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
    9    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'array_map'
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Faassj%3A9%241'
   13    14        SEND_VAL                                                 ~4
         15        INIT_FCALL                                               'token_get_all'
         16        SEND_VAL                                                 '%3C%3Fphp+if+%280+%3D%3D%3D+1%29+%7B%7D+else+if+%281+%3D%3D%3D+2%29+%7B%7D+else+%7B%7D'
         17        DO_ICALL                                         $5      
         18        SEND_VAR                                                 $5
         19        DO_ICALL                                         $6      
         20        SEND_VAR                                                 $6
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Faassj%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aassj
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'token_name'
          2        FETCH_DIM_R                                      ~2      !0, 0
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                         $3      
          5        ASSIGN_DIM                                               !0, 0
          6        OP_DATA                                                  $3
    6     7      > RETURN                                                   !0
    7     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Faassj%3A3%240

Function %00%7Bclosure%7D%2Fin%2Faassj%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aassj
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $token
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'token_name'
          2        FETCH_DIM_R                                      ~2      !0, 0
          3        SEND_VAL                                                 ~2
          4        DO_ICALL                                         $3      
          5        ASSIGN_DIM                                               !0, 0
          6        OP_DATA                                                  $3
   12     7      > RETURN                                                   !0
   13     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Faassj%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.77 ms | 1405 KiB | 21 Q