3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MethodTest { public function nonStaticFunction() { MethodTest::runTest(); } public function __call($name, $arguments) { var_dump($this); // Note: value of $name is case sensitive. echo "Calling object method '$name' " . implode(', ', $arguments). "\n"; } /** As of PHP 5.3.0 */ public static function __callStatic($name, $arguments) { var_dump($this); // Note: value of $name is case sensitive. echo "Calling static method '$name' " . implode(', ', $arguments). "\n"; } } $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/rTJ07
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/rTJ07
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/rTJ07
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      
   10     2        INIT_FCALL                                               'var_dump'
          3        FETCH_THIS                                       ~2      
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   13     6        ROPE_INIT                                     3  ~5      'Calling+object+method+%27'
          7        ROPE_ADD                                      1  ~5      ~5, !0
          8        ROPE_END                                      2  ~4      ~5, '%27+'
   14     9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%2C+'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13        CONCAT                                           ~8      ~4, $7
         14        CONCAT                                           ~9      ~8, '%0A'
         15        ECHO                                                     ~9
   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/rTJ07
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      
   20     2        INIT_FCALL                                               'var_dump'
          3        FETCH_THIS                                       ~2      
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
   23     6        ROPE_INIT                                     3  ~5      'Calling+static+method+%27'
          7        ROPE_ADD                                      1  ~5      ~5, !0
          8        ROPE_END                                      2  ~4      ~5, '%27+'
   24     9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%2C+'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13        CONCAT                                           ~8      ~4, $7
         14        CONCAT                                           ~9      ~8, '%0A'
         15        ECHO                                                     ~9
   25    16      > RETURN                                                   null

End of function __callstatic

End of class MethodTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.23 ms | 1400 KiB | 17 Q