3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GetValue(&$obj, $defaultValue = null) { return isset($obj) ? $obj : $defaultValue; } class foo { public $bar; } $x = new foo(); var_dump(GetValue($x->bar->baz)); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oesQP
function name:  (null)
number of ops:  12
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'getvalue'
          5        FETCH_OBJ_W                                      $4      !0, 'bar'
          6        FETCH_OBJ_W                                      $5      $4, 'baz'
          7        SEND_REF                                                 $5
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   10    11      > RETURN                                                   1

Function getvalue:
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/oesQP
function name:  GetValue
number of ops:  9
compiled vars:  !0 = $obj, !1 = $defaultValue
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                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      !0
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      !1
          7    > > RETURN                                                   ~3
    4     8*     > RETURN                                                   null

End of function getvalue

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.82 ms | 1002 KiB | 15 Q