3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func(&$val) { return isset($val) ? $val : 123; } $a1 = array(); $val = func($a1['x']); var_dump($val); // int(123) $a2 = array('x' => 987); $val = func($a2['x']); var_dump($val); // int(987)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ejXTV
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a1, !1 = $val, !2 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'func'
          2        FETCH_DIM_W                                      $4      !0, 'x'
          3        SEND_REF                                                 $4
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
    9     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   11     9        ASSIGN                                                   !2, <array>
   12    10        INIT_FCALL                                               'func'
         11        FETCH_DIM_W                                      $9      !2, 'x'
         12        SEND_REF                                                 $9
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                                   !1, $10
   13    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.32 ms | 1390 KiB | 17 Q