3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public static function __callStatic($method, $args) { if ($method == 'new') echo 'Base::new() called successfully'; } public function __call($method, $args) { if ($method == 'new') echo '$base->new() called successfully'; } } $base = Base::new(); call_user_func(array('Base', 'new')); $base = new Base; $base->new();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/clKJj
function name:  (null)
number of ops:  11
compiled vars:  !0 = $base
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_STATIC_METHOD_CALL                                  'Base', 'new'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   15     3        INIT_USER_CALL                                0          'call_user_func', <array>
          4        DO_FCALL                                      0          
   16     5        NEW                                              $4      'Base'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $4
   17     8        INIT_METHOD_CALL                                         !0, 'new'
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Class Base:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/clKJj
function name:  __callStatic
number of ops:  6
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        IS_EQUAL                                                 !0, 'new'
          3      > JMPZ                                                     ~2, ->5
    6     4    >   ECHO                                                     'Base%3A%3Anew%28%29+called+successfully'
    7     5    > > RETURN                                                   null

End of function __callstatic

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/clKJj
function name:  __call
number of ops:  6
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        IS_EQUAL                                                 !0, 'new'
          3      > JMPZ                                                     ~2, ->5
   10     4    >   ECHO                                                     '%24base-%3Enew%28%29+called+successfully'
   11     5    > > RETURN                                                   null

End of function __call

End of class Base.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.37 ms | 1395 KiB | 13 Q