3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function m() { static $x; if ($x === null) { $x = get_class($this); } return $x; } } class B extends A { } $a = new A(); $b = new B(); echo $a->m()."\n"; echo $b->m()."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bRlJ4
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   22     6        INIT_METHOD_CALL                                         !0, 'm'
          7        DO_FCALL                                      0  $8      
          8        CONCAT                                           ~9      $8, '%0A'
          9        ECHO                                                     ~9
   23    10        INIT_METHOD_CALL                                         !1, 'm'
         11        DO_FCALL                                      0  $10     
         12        CONCAT                                           ~11     $10, '%0A'
         13        ECHO                                                     ~11
         14      > RETURN                                                   1

Class A:
Function m:
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/bRlJ4
function name:  m
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->6
    8     3    >   FETCH_THIS                                       ~2      
          4        GET_CLASS                                        ~3      ~2
          5        ASSIGN                                                   !0, ~3
   10     6    > > RETURN                                                   !0
   11     7*     > RETURN                                                   null

End of function m

End of class A.

Class B:
Function m:
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/bRlJ4
function name:  m
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->6
    8     3    >   FETCH_THIS                                       ~2      
          4        GET_CLASS                                        ~3      ~2
          5        ASSIGN                                                   !0, ~3
   10     6    > > RETURN                                                   !0
   11     7*     > RETURN                                                   null

End of function m

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.72 ms | 1434 KiB | 13 Q