3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function test() { $i = new static; echo get_class($i); } } class B extends A { public $s = 't'; } A::test(); B::test()->s;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NiNXc
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test'
          1        DO_FCALL                                      0          
   18     2        INIT_STATIC_METHOD_CALL                                  'B', 'test'
          3        DO_FCALL                                      0  $1      
          4        FETCH_OBJ_R                                      ~2      $1, 's'
          5        FREE                                                     ~2
          6      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NiNXc
function name:  test
number of ops:  6
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    7     3        GET_CLASS                                        ~4      !0
          4        ECHO                                                     ~4
    8     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/NiNXc
function name:  test
number of ops:  6
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                          static              $1      
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    7     3        GET_CLASS                                        ~4      !0
          4        ECHO                                                     ~4
    8     5      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.39 ms | 1394 KiB | 13 Q