3v4l.org

run code in 500+ PHP versions simultaneously
<?php function anon() { static $i = 0; return eval(sprintf('return new class { private $prop%s; };', ++$i)); } $c1 = anon(); $c2 = anon(); var_dump($c1, $c2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RiRcW
function name:  (null)
number of ops:  11
compiled vars:  !0 = $c1, !1 = $c2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                                   'anon'
          1        DO_FCALL                                          0  $2      
          2        ASSIGN                                                       !0, $2
   10     3        INIT_FCALL                                                   'anon'
          4        DO_FCALL                                          0  $4      
          5        ASSIGN                                                       !1, $4
   12     6        INIT_FCALL                                                   'var_dump'
          7        SEND_VAR                                                     !0
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                                     
         10      > RETURN                                                       1

Function anon:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RiRcW
function name:  anon
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                                  !0
    6     1        PRE_INC                                              ~1      !0
          2        ROPE_INIT                                         3  ~3      'return+new+class+%7B+private+%24prop'
          3        ROPE_ADD                                          1  ~3      ~3, ~1
          4        ROPE_END                                          2  ~2      ~3, '%3B+%7D%3B'
          5        INCLUDE_OR_EVAL                                      $5      ~2, EVAL
          6      > RETURN                                                       $5
    7     7*     > RETURN                                                       null

End of function anon

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.94 ms | 2647 KiB | 16 Q