3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { public string $hello = "world"; } class Test { public static $TEST = "B"; public string $test = "B"; public function test() { return "B"; } } $class = new Test(); $test = new Test::$TEST; echo $test->hello; $test = new $class::$TEST; echo $test->hello; $test = new $class->test; echo $test->hello; $test = new $class->test(); echo $test->hello;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PmCfR
function name:  (null)
number of ops:  33
compiled vars:  !0 = $class, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   19     3        FETCH_STATIC_PROP_R          global lock         ~5      'TEST'
          4        FETCH_CLASS                                   0  $6      ~5
          5        NEW                                              $7      $6
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   20     8        FETCH_OBJ_R                                      ~10     !1, 'hello'
          9        ECHO                                                     ~10
   22    10        FETCH_CLASS                                   0  $11     !0
         11        FETCH_STATIC_PROP_R          unknown             ~12     'TEST'
         12        FETCH_CLASS                                   0  $13     ~12
         13        NEW                                              $14     $13
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $14
   23    16        FETCH_OBJ_R                                      ~17     !1, 'hello'
         17        ECHO                                                     ~17
   25    18        FETCH_OBJ_R                                      ~18     !0, 'test'
         19        FETCH_CLASS                                   0  $19     ~18
         20        NEW                                              $20     $19
         21        DO_FCALL                                      0          
         22        ASSIGN                                                   !1, $20
   26    23        FETCH_OBJ_R                                      ~23     !1, 'hello'
         24        ECHO                                                     ~23
   28    25        FETCH_OBJ_R                                      ~24     !0, 'test'
         26        FETCH_CLASS                                   0  $25     ~24
         27        NEW                                              $26     $25
         28        DO_FCALL                                      0          
         29        ASSIGN                                                   !1, $26
   29    30        FETCH_OBJ_R                                      ~29     !1, 'hello'
         31        ECHO                                                     ~29
   30    32      > RETURN                                                   1

Class B: [no user functions]
Class Test:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PmCfR
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   'B'
   14     1*     > RETURN                                                   null

End of function test

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.04 ms | 996 KiB | 13 Q