3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { const FOOBAR = 'baz'; } $obj = new stdClass; $obj->blah = new Example; $cls = $obj->blah; var_dump($cls::FOOBAR);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cFNuo
function name:  (null)
number of ops:  15
compiled vars:  !0 = $obj, !1 = $cls
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    8     3        NEW                                              $6      'Example'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'blah'
          6        OP_DATA                                                  $6
    9     7        FETCH_OBJ_R                                      ~8      !0, 'blah'
          8        ASSIGN                                                   !1, ~8
   10     9        INIT_FCALL                                               'var_dump'
         10        FETCH_CLASS                                   0  $10     !1
         11        FETCH_CLASS_CONSTANT                             ~11     $10, 'FOOBAR'
         12        SEND_VAL                                                 ~11
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Example: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1394 KiB | 15 Q