3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class a { public function __call ($name,$arguments) { if ($name == 'getb') return new b; throw new Exception('error'); } abstract function p(); } class b extends a { public function p () { echo 123; } } $a = new a; $b = $a->getb(); $b->p();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCX1a
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        INIT_METHOD_CALL                                         !0, 'getb'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   20     6        INIT_METHOD_CALL                                         !1, 'p'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class a:
Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/JCX1a
function name:  __call
number of ops:  12
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        IS_EQUAL                                                 !0, 'getb'
          3      > JMPZ                                                     ~2, ->7
          4    >   NEW                                              $3      'b'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   $3
    6     7    >   NEW                                              $5      'Exception'
          8        SEND_VAL_EX                                              'error'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $5
    7    11*     > RETURN                                                   null

End of function __call

Function p:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCX1a
function name:  p
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function p

End of class a.

Class b:
Function p:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCX1a
function name:  p
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     123
   15     1      > RETURN                                                   null

End of function p

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/JCX1a
function name:  __call
number of ops:  12
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        IS_EQUAL                                                 !0, 'getb'
          3      > JMPZ                                                     ~2, ->7
          4    >   NEW                                              $3      'b'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   $3
    6     7    >   NEW                                              $5      'Exception'
          8        SEND_VAL_EX                                              'error'
          9        DO_FCALL                                      0          
         10      > THROW                                         0          $5
    7    11*     > RETURN                                                   null

End of function __call

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.02 ms | 1399 KiB | 13 Q