3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original = []; foreach (range(1, 20_000) as $iteration) { $original[] = [ 'id' => str_repeat("{$iteration}.", 4), 'name' => 'name', ]; } var_dump( array_map( static function (array $item): string { return "{$item['id']}#{$item['name']}"; }, array_filter( $original, static function (array $item): bool { return str_starts_with($item['id'], '11'); } ) ) );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/SOetO
function name:  (null)
number of ops:  33
compiled vars:  !0 = $original, !1 = $iteration
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 20000
          4        DO_ICALL                                         $3      
          5      > FE_RESET_R                                       $4      $3, ->18
          6    > > FE_FETCH_R                                               $4, !1, ->18
    6     7    >   INIT_FCALL                                               'str_repeat'
          8        NOP                                                      
          9        FAST_CONCAT                                      ~6      !1, '.'
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 4
         12        DO_ICALL                                         $7      
         13        INIT_ARRAY                                       ~8      $7, 'id'
    7    14        ADD_ARRAY_ELEMENT                                ~8      'name', 'name'
    5    15        ASSIGN_DIM                                               !0
    7    16        OP_DATA                                                  ~8
    4    17      > JMP                                                      ->6
         18    >   FE_FREE                                                  $4
   11    19        INIT_FCALL                                               'var_dump'
   12    20        INIT_FCALL                                               'array_map'
   13    21        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FSOetO%3A13%240'
   15    22        SEND_VAL                                                 ~9
   16    23        INIT_FCALL                                               'array_filter'
   17    24        SEND_VAR                                                 !0
   18    25        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FSOetO%3A18%241'
   20    26        SEND_VAL                                                 ~10
         27        DO_ICALL                                         $11     
         28        SEND_VAR                                                 $11
         29        DO_ICALL                                         $12     
         30        SEND_VAR                                                 $12
         31        DO_ICALL                                                 
   23    32      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FSOetO%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOetO
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        FETCH_DIM_R                                      ~1      !0, 'id'
          2        ROPE_INIT                                     3  ~4      ~1
          3        ROPE_ADD                                      1  ~4      ~4, '%23'
          4        FETCH_DIM_R                                      ~2      !0, 'name'
          5        ROPE_END                                      2  ~3      ~4, ~2
          6        VERIFY_RETURN_TYPE                                       ~3
          7      > RETURN                                                   ~3
   15     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FSOetO%3A13%240

Function %00%7Bclosure%7D%2Fin%2FSOetO%3A18%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SOetO
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'str_starts_with'
          2        FETCH_DIM_R                                      ~1      !0, 'id'
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 '11'
          5        DO_ICALL                                         $2      
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
   20     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FSOetO%3A18%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.98 ms | 1411 KiB | 25 Q