3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MethodTest { public function nonStaticFunction() { MethodTest::runTest(); } public function __call($name, $arguments) { // Note: value of $name is case sensitive. echo "Calling object method '$name' " . implode(', ', $arguments). "\n"; var_dump($this); } /** As of PHP 5.3.0 */ public static function __callStatic($name, $arguments) { // Note: value of $name is case sensitive. echo "Calling static method '$name' " . implode(', ', $arguments). "\n"; var_dump($this); } } $obj = new MethodTest; $obj->runTest('in object context'); MethodTest::runTest('in static context'); $obj->nonStaticFunction();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L01pF
function name:  (null)
number of ops:  12
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $1      'MethodTest'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   29     3        INIT_METHOD_CALL                                         !0, 'runTest'
          4        SEND_VAL_EX                                              'in+object+context'
          5        DO_FCALL                                      0          
   30     6        INIT_STATIC_METHOD_CALL                                  'MethodTest', 'runTest'
          7        SEND_VAL_EX                                              'in+static+context'
          8        DO_FCALL                                      0          
   31     9        INIT_METHOD_CALL                                         !0, 'nonStaticFunction'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class MethodTest:
Function nonstaticfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L01pF
function name:  nonStaticFunction
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_STATIC_METHOD_CALL                                  'MethodTest', 'runTest'
          1        DO_FCALL                                      0          
    7     2      > RETURN                                                   null

End of function nonstaticfunction

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L01pF
function name:  __call
number of ops:  17
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        ROPE_INIT                                     3  ~3      'Calling+object+method+%27'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%27+'
   12     5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 '%2C+'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        CONCAT                                           ~6      ~2, $5
         10        CONCAT                                           ~7      ~6, '%0A'
         11        ECHO                                                     ~7
   14    12        INIT_FCALL                                               'var_dump'
         13        FETCH_THIS                                       ~8      
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   15    16      > 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/L01pF
function name:  __callStatic
number of ops:  17
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        ROPE_INIT                                     3  ~3      'Calling+static+method+%27'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%27+'
   22     5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 '%2C+'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $5      
          9        CONCAT                                           ~6      ~2, $5
         10        CONCAT                                           ~7      ~6, '%0A'
         11        ECHO                                                     ~7
   24    12        INIT_FCALL                                               'var_dump'
         13        FETCH_THIS                                       ~8      
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   25    16      > RETURN                                                   null

End of function __callstatic

End of class MethodTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.41 ms | 1400 KiB | 17 Q