3v4l.org

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

Class a:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B0DuC
function name:  test
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                         '%3D%3D%3D+static%3A%3Aclass+%3D%3D%3D%0A'
    6     1        INIT_FCALL                                                   'var_dump'
          2        FETCH_CLASS_NAME                                     ~0      
          3        SEND_VAL                                                     ~0
          4        DO_ICALL                                                     
    7     5      > RETURN                                                       null

End of function test

End of class a.

Class b:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B0DuC
function name:  test
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                         '%3D%3D%3D+static%3A%3Aclass+%3D%3D%3D%0A'
    6     1        INIT_FCALL                                                   'var_dump'
          2        FETCH_CLASS_NAME                                     ~0      
          3        SEND_VAL                                                     ~0
          4        DO_ICALL                                                     
    7     5      > RETURN                                                       null

End of function test

End of class b.

Class c:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B0DuC
function name:  test
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                         '%3D%3D%3D+static%3A%3Aclass+%3D%3D%3D%0A'
    6     1        INIT_FCALL                                                   'var_dump'
          2        FETCH_CLASS_NAME                                     ~0      
          3        SEND_VAL                                                     ~0
          4        DO_ICALL                                                     
    7     5      > RETURN                                                       null

End of function test

End of class c.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
166.68 ms | 1557 KiB | 9 Q