3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a {public $val=1;} class b {public $val=2;} const CLASSES = array("one"=>'a', "two"=>'b'); $a = CLASSES['one']; var_dump(new $a());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/89PP3
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CONST                                            'CLASSES', <array>
    6     1        FETCH_CONSTANT                                   ~1      'CLASSES'
          2        FETCH_DIM_R                                      ~2      ~1, 'one'
          3        ASSIGN                                                   !0, ~2
    7     4        INIT_FCALL                                               'var_dump'
          5        FETCH_CLASS                                   0  $4      !0
          6        NEW                                              $5      $4
          7        DO_FCALL                                      0          
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class a: [no user functions]
Class b: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.76 ms | 1008 KiB | 14 Q