3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassWithBothMagicCallMethods { public function __call($name, $args) { return "__call: " . $name; } public static function __callStatic($name, $args) { return "__callStatic: " . $name; } public function doSomething() { return static::magicCall(); } } class ClassWithCallStaticOnly { public static function __callStatic($name, $args) { return "__callStatic: " . $name; } public function doSomething() { return static::magicCall(); } } echo (new ClassWithCallStaticOnly())->doSomething() . PHP_EOL; echo (new ClassWithBothMagicCallMethods())->doSomething() . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0MEJ
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $0      'ClassWithCallStaticOnly'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'doSomething'
          3        DO_FCALL                                      0  $2      
          4        CONCAT                                           ~3      $2, '%0A'
          5        ECHO                                                     ~3
   35     6        NEW                                              $4      'ClassWithBothMagicCallMethods'
          7        DO_FCALL                                      0          
          8        INIT_METHOD_CALL                                         $4, 'doSomething'
          9        DO_FCALL                                      0  $6      
         10        CONCAT                                           ~7      $6, '%0A'
         11        ECHO                                                     ~7
   36    12      > RETURN                                                   1

Class ClassWithBothMagicCallMethods:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0MEJ
function name:  __call
number of ops:  5
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        CONCAT                                           ~2      '__call%3A+', !0
          3      > RETURN                                                   ~2
    8     4*     > RETURN                                                   null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0MEJ
function name:  __callStatic
number of ops:  5
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        CONCAT                                           ~2      '__callStatic%3A+', !0
          3      > RETURN                                                   ~2
   13     4*     > RETURN                                                   null

End of function __callstatic

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0MEJ
function name:  doSomething
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'magicCall'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   18     3*     > RETURN                                                   null

End of function dosomething

End of class ClassWithBothMagicCallMethods.

Class ClassWithCallStaticOnly:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0MEJ
function name:  __callStatic
number of ops:  5
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   25     2        CONCAT                                           ~2      '__callStatic%3A+', !0
          3      > RETURN                                                   ~2
   26     4*     > RETURN                                                   null

End of function __callstatic

Function dosomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F0MEJ
function name:  doSomething
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_STATIC_METHOD_CALL                                  'magicCall'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   31     3*     > RETURN                                                   null

End of function dosomething

End of class ClassWithCallStaticOnly.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.75 ms | 1000 KiB | 13 Q