3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { const A = 1; } $o = new A; var_dump(A::A, $o::A, constant(get_class($o) . '::A'), constant(array(get_class($o), 'A')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CSOqQ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    9     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAL                                                 1
          5        FETCH_CLASS                                   0  $4      !0
          6        FETCH_CLASS_CONSTANT                             ~5      $4, 'A'
          7        SEND_VAL                                                 ~5
          8        INIT_FCALL                                               'constant'
          9        GET_CLASS                                        ~6      !0
         10        CONCAT                                           ~7      ~6, '%3A%3AA'
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
         14        INIT_FCALL                                               'constant'
         15        GET_CLASS                                        ~9      !0
         16        INIT_ARRAY                                       ~10     ~9
         17        ADD_ARRAY_ELEMENT                                ~10     'A'
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class A: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.77 ms | 1395 KiB | 17 Q