3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ ['DTSTART' => '2017-01-02', 'SUMMARY;LANGUAGE=en' => 'Non-recyclable waste'], ['DTSTART' => '2017-01-03', 'SUMMARY;LANGUAGE=en' => 'Bio-waste'], ['DTSTART' => '2017-01-04', 'SUMMARY;LANGUAGE=en' => 'Junk'], ]; $finalDate = '2038-12-31'; $result = []; foreach ($arr as $value) { if ($value['DTSTART'] > $finalDate) { continue; } $result[] = [ 'day' => $value['DTSTART'], 'type' => $value['SUMMARY;LANGUAGE=en'], ...match($value['SUMMARY;LANGUAGE=en']) { 'Non-recyclable waste', 'Bio-waste' => ['color' => 'success'], default => [] } ]; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 24
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
3 jumps found. (Code = 195) Position 1 = 15, Position 2 = 15, Position 3 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/cK18Y
function name:  (null)
number of ops:  29
compiled vars:  !0 = $arr, !1 = $finalDate, !2 = $result, !3 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        ASSIGN                                                   !1, '2038-12-31'
   10     2        ASSIGN                                                   !2, <array>
   11     3      > FE_RESET_R                                       $7      !0, ->24
          4    > > FE_FETCH_R                                               $7, !3, ->24
   12     5    >   FETCH_DIM_R                                      ~8      !3, 'DTSTART'
          6        IS_SMALLER                                               !1, ~8
          7      > JMPZ                                                     ~9, ->9
   13     8    > > JMP                                                      ->4
   17     9    >   FETCH_DIM_R                                      ~11     !3, 'DTSTART'
         10        INIT_ARRAY                                       ~12     ~11, 'day'
   18    11        FETCH_DIM_R                                      ~13     !3, 'SUMMARY%3BLANGUAGE%3Den'
         12        ADD_ARRAY_ELEMENT                                ~12     ~13, 'type'
   19    13        FETCH_DIM_R                                      ~14     !3, 'SUMMARY%3BLANGUAGE%3Den'
         14      > MATCH                                                    ~14, [ 'Non-recyclable+waste':->15, 'Bio-waste':->15, ], ->17
   20    15    >   QM_ASSIGN                                        ~16     <array>
         16      > JMP                                                      ->19
   21    17    >   QM_ASSIGN                                        ~16     <array>
         18      > JMP                                                      ->19
         19    >   FREE                                                     ~14
         20        ADD_ARRAY_UNPACK                                 ~12     ~16
   16    21        ASSIGN_DIM                                               !2
   21    22        OP_DATA                                                  ~12
   11    23      > JMP                                                      ->4
         24    >   FE_FREE                                                  $7
   25    25        INIT_FCALL                                               'var_export'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.75 ms | 1011 KiB | 14 Q