3v4l.org

run code in 300+ PHP versions simultaneously
<?php class return_a{} class return_b{} class return_c{} /** * @method A(): return_a * @method B(): return_b * @method C(): return_c */ class Database { public function method_a($proc_name, $args): return_a { return new return_a($proc_name, $args); } public function method_b($proc_name, $args): return_b { return new return_b($proc_name, $args); } public function method_c($proc_name, $args): return_c { return new return_c($proc_name, $args); } public function __call($function, $args): return_a|return_b|return_c|null { return match ($function) { "A" => $this->method_a($function, $args), "B" => $this->method_b($function, $args), "C" => $this->method_c($function, $args), default => null, }; } } (new Database)->A();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9v6HO
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   NEW                                              $0      'Database'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'A'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class return_a: [no user functions]
Class return_b: [no user functions]
Class return_c: [no user functions]
Class Database:
Function method_a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9v6HO
function name:  method_a
number of ops:  10
compiled vars:  !0 = $proc_name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        NEW                                              $2      'return_a'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
   17     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function method_a

Function method_b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9v6HO
function name:  method_b
number of ops:  10
compiled vars:  !0 = $proc_name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        NEW                                              $2      'return_b'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
   22     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function method_b

Function method_c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9v6HO
function name:  method_c
number of ops:  10
compiled vars:  !0 = $proc_name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   26     2        NEW                                              $2      'return_c'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
   27     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function method_c

Function __call:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 195) Position 1 = 3, Position 2 = 9, Position 3 = 15, Position 4 = 21
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
filename:       /in/9v6HO
function name:  __call
number of ops:  27
compiled vars:  !0 = $function, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   31     2      > MATCH                                                    !0, [ 'A':->3, 'B':->9, 'C':->15, ], ->21
   32     3    >   INIT_METHOD_CALL                                         'method_a'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $3      
          7        QM_ASSIGN                                        ~4      $3
          8      > JMP                                                      ->23
   33     9    >   INIT_METHOD_CALL                                         'method_b'
         10        SEND_VAR_EX                                              !0
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $5      
         13        QM_ASSIGN                                        ~4      $5
         14      > JMP                                                      ->23
   34    15    >   INIT_METHOD_CALL                                         'method_c'
         16        SEND_VAR_EX                                              !0
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0  $6      
         19        QM_ASSIGN                                        ~4      $6
         20      > JMP                                                      ->23
   35    21    >   QM_ASSIGN                                        ~4      null
         22      > JMP                                                      ->23
         23    >   VERIFY_RETURN_TYPE                                       ~4
         24      > RETURN                                                   ~4
   38    25*       VERIFY_RETURN_TYPE                                       
         26*     > RETURN                                                   null

End of function __call

End of class Database.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.34 ms | 1000 KiB | 13 Q