3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { protected static $counter = 0; public static function __callStatic($name, $args) { return (new self())->test(); } public function publicWrapperOverTest() { return $this->test(); } protected function test() { return ++self::$counter; } } print (new TestClass)->publicWrapperOverTest(); print TestClass::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUtBB
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $0      'TestClass'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'publicWrapperOverTest'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   22     5        INIT_STATIC_METHOD_CALL                                  'TestClass', 'test'
          6        DO_FCALL                                      0  $3      
          7        ECHO                                                     $3
          8      > RETURN                                                   1

Class TestClass:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUtBB
function name:  __callStatic
number of ops:  8
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        NEW                          self                $2      
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $2, 'test'
          5        DO_FCALL                                      0  $4      
          6      > RETURN                                                   $4
    9     7*     > RETURN                                                   null

End of function __callstatic

Function publicwrapperovertest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUtBB
function name:  publicWrapperOverTest
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_METHOD_CALL                                         'test'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   14     3*     > RETURN                                                   null

End of function publicwrapperovertest

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AUtBB
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   PRE_INC_STATIC_PROP                              ~0      'counter'
          1      > RETURN                                                   ~0
   18     2*     > RETURN                                                   null

End of function test

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.07 ms | 940 KiB | 14 Q