3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); $map = [ 1 => 'foo', 2 => 'foo', 3 => 'bar', ]; $names = ['foo', 'bar', 'baz']; $array = ['foo' => [], 'bar' => [], 'baz' => []]; foreach ($map as $value => $name) { $array[$name][] = $value; } foreach ($array as $name => $elements) { echo sprintf('"%s" -> "%d".' . PHP_EOL, $name, count($elements) > 0); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 23
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 10
filename:       /in/6eAMe
function name:  (null)
number of ops:  25
compiled vars:  !0 = $map, !1 = $names, !2 = $array, !3 = $name, !4 = $value, !5 = $elements
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, <array>
    9     2        ASSIGN                                                   !2, <array>
   11     3      > FE_RESET_R                                       $9      !0, ->10
          4    > > FE_FETCH_R                                       ~10     $9, !3, ->10
          5    >   ASSIGN                                                   !4, ~10
   12     6        FETCH_DIM_W                                      $12     !2, !3
          7        ASSIGN_DIM                                               $12
          8        OP_DATA                                                  !4
   11     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $9
   16    11      > FE_RESET_R                                       $14     !2, ->23
         12    > > FE_FETCH_R                                       ~15     $14, !5, ->23
         13    >   ASSIGN                                                   !3, ~15
   17    14        INIT_FCALL                                               'sprintf'
         15        SEND_VAL                                                 '%22%25s%22+-%3E+%22%25d%22.%0A'
         16        SEND_VAR                                                 !3
         17        COUNT                                            ~17     !5
         18        IS_SMALLER                                       ~18     0, ~17
         19        SEND_VAL                                                 ~18
         20        DO_ICALL                                         $19     
         21        ECHO                                                     $19
   16    22      > JMP                                                      ->12
         23    >   FE_FREE                                                  $14
   18    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.07 ms | 1016 KiB | 14 Q