3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __call($method, $arguments) { 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/k9PBI
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 __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/k9PBI
function name:  __call
number of ops:  10
compiled vars:  !0 = $method, !1 = $arguments, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        BIND_STATIC                                              !2
    7     3        TYPE_CHECK                                    2          !2
          4      > JMPZ                                                     ~3, ->8
    8     5    >   FETCH_THIS                                       ~4      
          6        GET_CLASS                                        ~5      ~4
          7        ASSIGN                                                   !2, ~5
   10     8    > > RETURN                                                   !2
   11     9*     > RETURN                                                   null

End of function __call

End of class A.

Class B:
Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/k9PBI
function name:  __call
number of ops:  10
compiled vars:  !0 = $method, !1 = $arguments, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        BIND_STATIC                                              !2
    7     3        TYPE_CHECK                                    2          !2
          4      > JMPZ                                                     ~3, ->8
    8     5    >   FETCH_THIS                                       ~4      
          6        GET_CLASS                                        ~5      ~4
          7        ASSIGN                                                   !2, ~5
   10     8    > > RETURN                                                   !2
   11     9*     > RETURN                                                   null

End of function __call

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.61 ms | 1399 KiB | 13 Q