3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test1 { public function __call( $_method, $_args ) { echo get_class( $this ); echo method_exists( $this, $_method ); echo is_callable( array( $this, $_method ) ); // $this->lala(); die('g'); if ( method_exists( $this, $_method ) && is_callable( array( $this, $_method ) ) ) { $res = call_user_func_array( array( $this, $_method ), $_args ); if ( !is_null( $res ) ) return $res; if ( $this->prev_ ) return call_user_func_array( array( $this->prev_, $_method ), $_args );//return $this->defaultLocale( $_args ); } else { throw new Exception( "Invalid method: " . $_method ); } } } class test2 extends test1 { private function lala() { } } $t = new test2(); $t->lala(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o6cmQ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'test2'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   35     3        INIT_METHOD_CALL                                         !0, 'lala'
          4        DO_FCALL                                      0          
   36     5      > RETURN                                                   1

Class test1:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/o6cmQ
function name:  __call
number of ops:  62
compiled vars:  !0 = $_method, !1 = $_args, !2 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        FETCH_THIS                                       ~3      
          3        GET_CLASS                                        ~4      ~3
          4        ECHO                                                     ~4
    8     5        INIT_FCALL                                               'method_exists'
          6        FETCH_THIS                                       ~5      
          7        SEND_VAL                                                 ~5
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
         10        ECHO                                                     $6
    9    11        INIT_FCALL                                               'is_callable'
         12        FETCH_THIS                                       ~7      
         13        INIT_ARRAY                                       ~8      ~7
         14        ADD_ARRAY_ELEMENT                                ~8      !0
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        ECHO                                                     $9
   11    18      > EXIT                                                     'g'
   12    19*       INIT_FCALL                                               'method_exists'
         20*       FETCH_THIS                                       ~10     
         21*       SEND_VAL                                                 ~10
         22*       SEND_VAR                                                 !0
         23*       DO_ICALL                                         $11     
         24*       JMPZ_EX                                          ~12     $11, ->32
         25*       INIT_FCALL                                               'is_callable'
         26*       FETCH_THIS                                       ~13     
         27*       INIT_ARRAY                                       ~14     ~13
         28*       ADD_ARRAY_ELEMENT                                ~14     !0
         29*       SEND_VAL                                                 ~14
         30*       DO_ICALL                                         $15     
         31*       BOOL                                             ~12     $15
         32*       JMPZ                                                     ~12, ->56
   14    33*       FETCH_THIS                                       ~16     
         34*       INIT_ARRAY                                       ~17     ~16
         35*       ADD_ARRAY_ELEMENT                                ~17     !0
         36*       INIT_USER_CALL                                0          'call_user_func_array', ~17
         37*       SEND_ARRAY                                               !1
         38*       CHECK_UNDEF_ARGS                                         
         39*       DO_FCALL                                      0  $18     
         40*       ASSIGN                                                   !2, $18
   16    41*       TYPE_CHECK                                    2  ~20     !2
         42*       BOOL_NOT                                         ~21     ~20
         43*       JMPZ                                                     ~21, ->45
         44*       RETURN                                                   !2
   18    45*       FETCH_OBJ_R                                      ~22     'prev_'
         46*       JMPZ                                                     ~22, ->55
         47*       FETCH_OBJ_R                                      ~23     'prev_'
         48*       INIT_ARRAY                                       ~24     ~23
         49*       ADD_ARRAY_ELEMENT                                ~24     !0
         50*       INIT_USER_CALL                                0          'call_user_func_array', ~24
         51*       SEND_ARRAY                                               !1
         52*       CHECK_UNDEF_ARGS                                         
         53*       DO_FCALL                                      0  $25     
         54*       RETURN                                                   $25
         55*       JMP                                                      ->61
   22    56*       NEW                                              $26     'Exception'
         57*       CONCAT                                           ~27     'Invalid+method%3A+', !0
         58*       SEND_VAL_EX                                              ~27
         59*       DO_FCALL                                      0          
         60*       THROW                                         0          $26
   24    61*     > RETURN                                                   null

End of function __call

End of class test1.

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

End of function lala

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/o6cmQ
function name:  __call
number of ops:  62
compiled vars:  !0 = $_method, !1 = $_args, !2 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        FETCH_THIS                                       ~3      
          3        GET_CLASS                                        ~4      ~3
          4        ECHO                                                     ~4
    8     5        INIT_FCALL                                               'method_exists'
          6        FETCH_THIS                                       ~5      
          7        SEND_VAL                                                 ~5
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $6      
         10        ECHO                                                     $6
    9    11        INIT_FCALL                                               'is_callable'
         12        FETCH_THIS                                       ~7      
         13        INIT_ARRAY                                       ~8      ~7
         14        ADD_ARRAY_ELEMENT                                ~8      !0
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        ECHO                                                     $9
   11    18      > EXIT                                                     'g'
   12    19*       INIT_FCALL                                               'method_exists'
         20*       FETCH_THIS                                       ~10     
         21*       SEND_VAL                                                 ~10
         22*       SEND_VAR                                                 !0
         23*       DO_ICALL                                         $11     
         24*       JMPZ_EX                                          ~12     $11, ->32
         25*       INIT_FCALL                                               'is_callable'
         26*       FETCH_THIS                                       ~13     
         27*       INIT_ARRAY                                       ~14     ~13
         28*       ADD_ARRAY_ELEMENT                                ~14     !0
         29*       SEND_VAL                                                 ~14
         30*       DO_ICALL                                         $15     
         31*       BOOL                                             ~12     $15
         32*       JMPZ                                                     ~12, ->56
   14    33*       FETCH_THIS                                       ~16     
         34*       INIT_ARRAY                                       ~17     ~16
         35*       ADD_ARRAY_ELEMENT                                ~17     !0
         36*       INIT_USER_CALL                                0          'call_user_func_array', ~17
         37*       SEND_ARRAY                                               !1
         38*       CHECK_UNDEF_ARGS                                         
         39*       DO_FCALL                                      0  $18     
         40*       ASSIGN                                                   !2, $18
   16    41*       TYPE_CHECK                                    2  ~20     !2
         42*       BOOL_NOT                                         ~21     ~20
         43*       JMPZ                                                     ~21, ->45
         44*       RETURN                                                   !2
   18    45*       FETCH_OBJ_R                                      ~22     'prev_'
         46*       JMPZ                                                     ~22, ->55
         47*       FETCH_OBJ_R                                      ~23     'prev_'
         48*       INIT_ARRAY                                       ~24     ~23
         49*       ADD_ARRAY_ELEMENT                                ~24     !0
         50*       INIT_USER_CALL                                0          'call_user_func_array', ~24
         51*       SEND_ARRAY                                               !1
         52*       CHECK_UNDEF_ARGS                                         
         53*       DO_FCALL                                      0  $25     
         54*       RETURN                                                   $25
         55*       JMP                                                      ->61
   22    56*       NEW                                              $26     'Exception'
         57*       CONCAT                                           ~27     'Invalid+method%3A+', !0
         58*       SEND_VAL_EX                                              ~27
         59*       DO_FCALL                                      0          
         60*       THROW                                         0          $26
   24    61*     > RETURN                                                   null

End of function __call

End of class test2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.61 ms | 1413 KiB | 17 Q