3v4l.org

run code in 500+ PHP versions simultaneously
<?php class TestClass { protected static $counter = 0; public static function __callStatic($name, $args) { return (new self())->test(); } public function test() { return ++self::$counter; } } print (new TestClass)->test(); print TestClass::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gd1ba
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   NEW                                                  $0      'TestClass'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'test'
          3        DO_FCALL                                          0  $2      
          4        ECHO                                                         $2
   17     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/Gd1ba
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 test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gd1ba
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   PRE_INC_STATIC_PROP                                  ~0      'counter'
          1      > RETURN                                                       ~0
   13     2*     > RETURN                                                       null

End of function test

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.31 ms | 2140 KiB | 13 Q