3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { static function b() { static $c; if(!$c) { $c = get_class($this); } echo $c; } } class b extends a{} class c extends a{} b::b(); c::b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IeZEi
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'b', 'b'
          1        DO_FCALL                                      0          
   19     2        INIT_STATIC_METHOD_CALL                                  'c', 'b'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class a:
Function b:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/IeZEi
function name:  b
number of ops:  8
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->6
   10     3    >   FETCH_THIS                                       ~2      
          4        GET_CLASS                                        ~3      ~2
          5        ASSIGN                                                   !0, ~3
   12     6    >   ECHO                                                     !0
   13     7      > RETURN                                                   null

End of function b

End of class a.

Class b:
Function b:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/IeZEi
function name:  b
number of ops:  8
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->6
   10     3    >   FETCH_THIS                                       ~2      
          4        GET_CLASS                                        ~3      ~2
          5        ASSIGN                                                   !0, ~3
   12     6    >   ECHO                                                     !0
   13     7      > RETURN                                                   null

End of function b

End of class b.

Class c:
Function b:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/IeZEi
function name:  b
number of ops:  8
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    8     1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->6
   10     3    >   FETCH_THIS                                       ~2      
          4        GET_CLASS                                        ~3      ~2
          5        ASSIGN                                                   !0, ~3
   12     6    >   ECHO                                                     !0
   13     7      > RETURN                                                   null

End of function b

End of class c.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.51 ms | 1399 KiB | 13 Q