3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ifsetor(&$variable, $default = null) { if (isset($variable)) { $tmp = $variable; } else { $tmp = $default; } return $tmp; } $x = ifsetor($foo['a']['b'], 'bar'); echo $x;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7FRdO
function name:  (null)
number of ops:  9
compiled vars:  !0 = $x, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'ifsetor'
          1        FETCH_DIM_W                                      $2      !1, 'a'
          2        FETCH_DIM_W                                      $3      $2, 'b'
          3        SEND_REF                                                 $3
          4        SEND_VAL                                                 'bar'
          5        DO_FCALL                                      0  $4      
          6        ASSIGN                                                   !0, $4
   11     7        ECHO                                                     !0
          8      > RETURN                                                   1

Function ifsetor:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7FRdO
function name:  ifsetor
number of ops:  9
compiled vars:  !0 = $variable, !1 = $default, !2 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    3     2        ISSET_ISEMPTY_CV                                         !0
          3      > JMPZ                                                     ~3, ->6
    4     4    >   ASSIGN                                                   !2, !0
          5      > JMP                                                      ->7
    6     6    >   ASSIGN                                                   !2, !1
    8     7    > > RETURN                                                   !2
    9     8*     > RETURN                                                   null

End of function ifsetor

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.67 ms | 1397 KiB | 14 Q