3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bar = 1; $obj = new class($foo = $bar) { public function __construct($test) { var_dump($test); } }; var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GB4dE
function name:  (null)
number of ops:  11
compiled vars:  !0 = $bar, !1 = $obj, !2 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
    3     1        DECLARE_ANON_CLASS                               <true>  
          2        NEW                                              $5      $4
          3        ASSIGN                                           ~6      !2, !0
          4        SEND_VAL_EX                                              ~6
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    8     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GB4dE
function name:  __construct
number of ops:  5
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    6     4      > RETURN                                                   null

End of function __construct

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.45 ms | 1395 KiB | 15 Q