3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { public function stuff() { echo $this->foo() . "\n"; echo static::foo() . "\n"; echo self::foo() . "\n"; } public static function foo() { return 'hello'; } } class Thing2 extends Thing { public static function foo() { return 'noooo'; } } $foo = new Thing2(); $foo->stuff();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eNaMm
function name:  (null)
number of ops:  6
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Thing2'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'stuff'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class Thing:
Function stuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eNaMm
function name:  stuff
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'foo'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%0A'
          3        ECHO                                                     ~1
    6     4        INIT_STATIC_METHOD_CALL                                  'foo'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      $2, '%0A'
          7        ECHO                                                     ~3
    7     8        INIT_STATIC_METHOD_CALL                                  'foo'
          9        DO_FCALL                                      0  $4      
         10        CONCAT                                           ~5      $4, '%0A'
         11        ECHO                                                     ~5
    8    12      > RETURN                                                   null

End of function stuff

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

End of function foo

End of class Thing.

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

End of function foo

Function stuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eNaMm
function name:  stuff
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'foo'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      $0, '%0A'
          3        ECHO                                                     ~1
    6     4        INIT_STATIC_METHOD_CALL                                  'foo'
          5        DO_FCALL                                      0  $2      
          6        CONCAT                                           ~3      $2, '%0A'
          7        ECHO                                                     ~3
    7     8        INIT_STATIC_METHOD_CALL                                  'foo'
          9        DO_FCALL                                      0  $4      
         10        CONCAT                                           ~5      $4, '%0A'
         11        ECHO                                                     ~5
    8    12      > RETURN                                                   null

End of function stuff

End of class Thing2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.21 ms | 1399 KiB | 13 Q