3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function m() { return $this->n(); } private function n() { 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/6bQWKA
function name:  (null)
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   24     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   26     6        INIT_METHOD_CALL                                         !0, 'm'
          7        DO_FCALL                                      0  $8      
          8        CONCAT                                           ~9      $8, '%0A'
          9        ECHO                                                     ~9
   27    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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6bQWKA
function name:  m
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_METHOD_CALL                                         'n'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function m

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

End of function n

End of class A.

Class B:
Function m:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6bQWKA
function name:  m
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_METHOD_CALL                                         'n'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
    7     3*     > RETURN                                                   null

End of function m

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

End of function n

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.26 ms | 1438 KiB | 13 Q