3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { static function get_class() { return __CLASS__; } static function baz() { $class = get_class(); return $class::qux(); } static function qux() { return 'qux'; } } class bar extends foo { static function get_class() { return __CLASS__; } static function qux() { return 'quux'; } } var_dump(foo::baz()); var_dump(bar::baz());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GDaoP
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'foo', 'baz'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   34     5        INIT_FCALL                                               'var_dump'
          6        INIT_STATIC_METHOD_CALL                                  'bar', 'baz'
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

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

End of function get_class

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GDaoP
function name:  baz
number of ops:  7
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   GET_CLASS                                        ~1      
          1        ASSIGN                                                   !0, ~1
   12     2        FETCH_CLASS                                   0  $3      !0
          3        INIT_STATIC_METHOD_CALL                                  $3, 'qux'
          4        DO_FCALL                                      0  $4      
          5      > RETURN                                                   $4
   13     6*     > RETURN                                                   null

End of function baz

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

End of function qux

End of class foo.

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

End of function get_class

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

End of function qux

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GDaoP
function name:  baz
number of ops:  7
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   GET_CLASS                                        ~1      
          1        ASSIGN                                                   !0, ~1
   12     2        FETCH_CLASS                                   0  $3      !0
          3        INIT_STATIC_METHOD_CALL                                  $3, 'qux'
          4        DO_FCALL                                      0  $4      
          5      > RETURN                                                   $4
   13     6*     > RETURN                                                   null

End of function baz

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.9 ms | 1400 KiB | 15 Q