3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public $someProp = 'hello world'; } class Foo { function getBar() { return new Bar(); } } $foo = new Foo(); echo ($foo->getBar())->someProp;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VRhUR
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'getBar'
          4        DO_FCALL                                      0  $4      
          5        FETCH_OBJ_R                                      ~5      $4, 'someProp'
          6        ECHO                                                     ~5
          7      > RETURN                                                   1

Class Bar: [no user functions]
Class Foo:
Function getbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VRhUR
function name:  getBar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $0      'Bar'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   15     3*     > RETURN                                                   null

End of function getbar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.65 ms | 1397 KiB | 13 Q