3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function callMe() { return static::class . '::hi'; } public static function hi() { print "Hi from " . static::class . "\n"; } } class B extends A { } $a = new A(); $callback = $a->callMe(); $callback(); $b = new B(); $callback = $b->callMe(); $callback();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fW1st
function name:  (null)
number of ops:  17
compiled vars:  !0 = $a, !1 = $callback, !2 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   NEW                                                  $3      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
   18     3        INIT_METHOD_CALL                                             !0, 'callMe'
          4        DO_FCALL                                          0  $6      
          5        ASSIGN                                                       !1, $6
   19     6        INIT_DYNAMIC_CALL                                            !1
          7        DO_FCALL                                          0          
   21     8        NEW                                                  $9      'B'
          9        DO_FCALL                                          0          
         10        ASSIGN                                                       !2, $9
   22    11        INIT_METHOD_CALL                                             !2, 'callMe'
         12        DO_FCALL                                          0  $12     
         13        ASSIGN                                                       !1, $12
   23    14        INIT_DYNAMIC_CALL                                            !1
         15        DO_FCALL                                          0          
         16      > RETURN                                                       1

Class A:
Function callme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fW1st
function name:  callMe
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   FETCH_CLASS_NAME                                     ~0      
          1        CONCAT                                               ~1      ~0, '%3A%3Ahi'
          2      > RETURN                                                       ~1
    6     3*     > RETURN                                                       null

End of function callme

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

End of function hi

End of class A.

Class B:
Function callme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fW1st
function name:  callMe
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   FETCH_CLASS_NAME                                     ~0      
          1        CONCAT                                               ~1      ~0, '%3A%3Ahi'
          2      > RETURN                                                       ~1
    6     3*     > RETURN                                                       null

End of function callme

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

End of function hi

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.71 ms | 2365 KiB | 13 Q