3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { function do_bar() { echo __METHOD__, "\n"; } } class Foo { function &do_foo() { $bar = new Bar(); return $bar; } } $foo = new Foo(); $foo->do_foo()->do_bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5QLRZ
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        INIT_METHOD_CALL                                         !0, 'do_foo'
          4        DO_FCALL                                      0  $4      
          5        INIT_METHOD_CALL                                         $4, 'do_bar'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class Bar:
Function do_bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5QLRZ
function name:  do_bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'Bar%3A%3Ado_bar'
          1        ECHO                                                     '%0A'
          2      > RETURN                                                   null

End of function do_bar

End of class Bar.

Class Foo:
Function do_foo:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/5QLRZ
function name:  do_foo
number of ops:  5
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3      > RETURN_BY_REF                                            !0
   10     4*     > RETURN_BY_REF                                            null

End of function do_foo

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.07 ms | 1385 KiB | 13 Q