3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public function baz() { return $this; } public static function foo() { $f=get_called_class(); return new $f(); } public function somethingElse() {} } Bar::foo()->baz()->somethingElse();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5WRQ
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'Bar', 'foo'
          1        DO_FCALL                                      0  $0      
          2        INIT_METHOD_CALL                                         $0, 'baz'
          3        DO_FCALL                                      0  $1      
          4        INIT_METHOD_CALL                                         $1, 'somethingElse'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function baz

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5WRQ
function name:  foo
number of ops:  7
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   GET_CALLED_CLASS                                 ~1      
          1        ASSIGN                                                   !0, ~1
          2        FETCH_CLASS                                   0  $3      !0
          3        NEW                                              $4      $3
          4        DO_FCALL                                      0          
          5      > RETURN                                                   $4
          6*     > RETURN                                                   null

End of function foo

Function somethingelse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5WRQ
function name:  somethingElse
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function somethingelse

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.86 ms | 1385 KiB | 13 Q