3v4l.org

run code in 300+ PHP versions simultaneously
<?php function coalesce() { foreach (func_get_args() as $arg) { if (null != $arg) { return $arg; } } return null; } var_dump(coalesce($foo['bar']['bar'], 1, null));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Lca6a
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'coalesce'
          2        FETCH_DIM_R                                      ~1      !0, 'bar'
          3        FETCH_DIM_R                                      ~2      ~1, 'bar'
          4        SEND_VAL                                                 ~2
          5        SEND_VAL                                                 1
          6        SEND_VAL                                                 null
          7        DO_FCALL                                      0  $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function coalesce:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/Lca6a
function name:  coalesce
number of ops:  11
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FUNC_GET_ARGS                                    ~1      
          1      > FE_RESET_R                                       $2      ~1, ->8
          2    > > FE_FETCH_R                                               $2, !0, ->8
    5     3    >   IS_NOT_EQUAL                                             !0, null
          4      > JMPZ                                                     ~3, ->7
    6     5    >   FE_FREE                                                  $2
          6      > RETURN                                                   !0
    4     7    > > JMP                                                      ->2
          8    >   FE_FREE                                                  $2
    9     9      > RETURN                                                   null
   10    10*     > RETURN                                                   null

End of function coalesce

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.03 ms | 1399 KiB | 16 Q