3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum MyEnum: string { case value = 'value'; } $object = new \stdClass(); $enum = MyEnum::value; $payload = 'payload'; $map = new \SplObjectStorage(); $map[$object] = $payload; $map[$enum] = $payload; foreach ($map as $key => $value) { var_dump($key, $value); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/gloDO
function name:  (null)
number of ops:  24
compiled vars:  !0 = $object, !1 = $enum, !2 = $payload, !3 = $map, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'myenum'
    8     1        NEW                                              $6      'stdClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    9     4        FETCH_CLASS_CONSTANT                             ~9      'MyEnum', 'value'
          5        ASSIGN                                                   !1, ~9
   10     6        ASSIGN                                                   !2, 'payload'
   11     7        NEW                                              $12     'SplObjectStorage'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $12
   12    10        ASSIGN_DIM                                               !3, !0
         11        OP_DATA                                                  !2
   13    12        ASSIGN_DIM                                               !3, !1
         13        OP_DATA                                                  !2
   15    14      > FE_RESET_R                                       $17     !3, ->22
         15    > > FE_FETCH_R                                       ~18     $17, !4, ->22
         16    >   ASSIGN                                                   !5, ~18
   16    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !5
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
   15    21      > JMP                                                      ->15
         22    >   FE_FREE                                                  $17
   17    23      > RETURN                                                   1

Class MyEnum: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.01 ms | 1445 KiB | 14 Q