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"; } /** 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"; } } $obj = new MethodTest; $obj->runTest('in object context'); MethodTest::runTest('in static context'); $obj->nonStaticFunction('in object context');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AuOug
function name:  (null)
number of ops:  13
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'MethodTest'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'runTest'
          4        SEND_VAL_EX                                              'in+object+context'
          5        DO_FCALL                                      0          
   26     6        INIT_STATIC_METHOD_CALL                                  'MethodTest', 'runTest'
          7        SEND_VAL_EX                                              'in+static+context'
          8        DO_FCALL                                      0          
   27     9        INIT_METHOD_CALL                                         !0, 'nonStaticFunction'
         10        SEND_VAL_EX                                              'in+object+context'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class MethodTest:
Function nonstaticfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AuOug
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/AuOug
function name:  __call
number of ops:  13
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
   13    12      > 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/AuOug
function name:  __callStatic
number of ops:  13
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        ROPE_INIT                                     3  ~3      'Calling+static+method+%27'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_END                                      2  ~2      ~3, '%27+'
   20     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
   21    12      > RETURN                                                   null

End of function __callstatic

End of class MethodTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.89 ms | 1392 KiB | 15 Q