3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getParent($child=null) { //mock: return array( (object)(array('user'=>'foo', 'data'=>'fee')), (object)(array('user'=>'far', 'data'=>'bee')), ); }; $result = array_shift(array_intersect_key(getParent('baz'), array(null)))->user; var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/327IF
function name:  (null)
number of ops:  16
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'array_shift'
          1        INIT_FCALL                                               'array_intersect_key'
          2        INIT_FCALL                                               'getparent'
          3        SEND_VAL                                                 'baz'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        SEND_VAL                                                 <array>
          7        DO_ICALL                                         $2      
          8        SEND_VAR_NO_REF                               0          $2
          9        DO_ICALL                                         $3      
         10        FETCH_OBJ_R                                      ~4      $3, 'user'
         11        ASSIGN                                                   !0, ~4
   14    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function getparent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/327IF
function name:  getParent
number of ops:  7
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
    7     1        CAST                                          8  ~1      <array>
          2        INIT_ARRAY                                       ~2      ~1
    8     3        CAST                                          8  ~3      <array>
          4        ADD_ARRAY_ELEMENT                                ~2      ~3
          5      > RETURN                                                   ~2
   10     6*     > RETURN                                                   null

End of function getparent

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.73 ms | 1398 KiB | 20 Q