3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyClass { public static $default_test = 'foo'; public $test; public function __construct() { $this->test = self::$default_test; } public function example() { return $this->test; } } MyClass::$default_test = 'bar'; $test = new MyClass(); echo $test->example(), PHP_EOL; MyClass::$default_test = 'hello'; $test = new MyClass(); echo $test->example();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/djn3T
function name:  (null)
number of ops:  18
compiled vars:  !0 = $test
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   ASSIGN_STATIC_PROP                                           'default_test', 'MyClass'
          1        OP_DATA                                                      'bar'
   21     2        NEW                                                  $2      'MyClass'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !0, $2
   22     5        INIT_METHOD_CALL                                             !0, 'example'
          6        DO_FCALL                                          0  $5      
          7        ECHO                                                         $5
          8        ECHO                                                         '%0A'
   24     9        ASSIGN_STATIC_PROP                                           'default_test', 'MyClass'
         10        OP_DATA                                                      'hello'
   26    11        NEW                                                  $7      'MyClass'
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !0, $7
   27    14        INIT_METHOD_CALL                                             !0, 'example'
         15        DO_FCALL                                          0  $10     
         16        ECHO                                                         $10
         17      > RETURN                                                       1

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/djn3T
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   FETCH_STATIC_PROP_R              unknown             ~1      'default_test'
          1        ASSIGN_OBJ                                                   'test'
          2        OP_DATA                                                      ~1
   11     3      > RETURN                                                       null

End of function __construct

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

End of function example

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.99 ms | 2521 KiB | 13 Q