3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public static function create() { return new MyClass(); } public function setFoo() { echo "foo\n"; return $this; } public function setBar() { echo "bar\n"; return $this; } } (MyClass::create()) ->setFoo() ->setBar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N6Wgm
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'MyClass', 'create'
          1        DO_FCALL                                      0  $0      
   20     2        INIT_METHOD_CALL                                         $0, 'setFoo'
          3        DO_FCALL                                      0  $1      
   21     4        INIT_METHOD_CALL                                         $1, 'setBar'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class MyClass:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N6Wgm
function name:  create
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $0      'MyClass'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    6     3*     > RETURN                                                   null

End of function create

Function setfoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N6Wgm
function name:  setFoo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'foo%0A'
   10     1        FETCH_THIS                                       ~0      
          2      > RETURN                                                   ~0
   11     3*     > RETURN                                                   null

End of function setfoo

Function setbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N6Wgm
function name:  setBar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'bar%0A'
   15     1        FETCH_THIS                                       ~0      
          2      > RETURN                                                   ~0
   16     3*     > RETURN                                                   null

End of function setbar

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.4 ms | 1003 KiB | 13 Q