3v4l.org

run code in 300+ PHP versions simultaneously
<?php $workers = Array( Array('name' => 'Иван Иванович Петров', 'bd' => '19.02.1974', 'sex' => 1), Array('name' => 'Ольга Михайловна Северова', 'bd' => '20.02.1984', 'sex' => 2), Array('name' => 'Виталий Олегович Кириллов', 'bd' => '21.02.1963', 'sex' => 1) ); $days = 10; $holy_workers = []; $date = new DateTimeImmutable(); foreach (range(0, $days) as $i) $holydays[] = $date->add(new DateInterval("P{$i}D"))->format('d.m'); foreach ($workers as $worker) if (in_array(substr($worker['bd'], 0, 5), $holydays)) $holy_workers[] = $worker; print_r($holy_workers);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 27
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 44
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 44
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 43
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
Branch analysis from position: 27
filename:       /in/8OYC9
function name:  (null)
number of ops:  49
compiled vars:  !0 = $workers, !1 = $days, !2 = $holy_workers, !3 = $date, !4 = $i, !5 = $holydays, !6 = $worker
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 10
   10     2        ASSIGN                                                   !2, <array>
   11     3        NEW                                              $10     'DateTimeImmutable'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !3, $10
   12     6        INIT_FCALL                                               'range'
          7        SEND_VAL                                                 0
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $13     
         10      > FE_RESET_R                                       $14     $13, ->27
         11    > > FE_FETCH_R                                               $14, !4, ->27
   13    12    >   INIT_METHOD_CALL                                         !3, 'add'
         13        NEW                                              $16     'DateInterval'
         14        ROPE_INIT                                     3  ~18     'P'
         15        ROPE_ADD                                      1  ~18     ~18, !4
         16        ROPE_END                                      2  ~17     ~18, 'D'
         17        SEND_VAL_EX                                              ~17
         18        DO_FCALL                                      0          
         19        SEND_VAR_NO_REF_EX                                       $16
         20        DO_FCALL                                      0  $21     
         21        INIT_METHOD_CALL                                         $21, 'format'
         22        SEND_VAL_EX                                              'd.m'
         23        DO_FCALL                                      0  $22     
         24        ASSIGN_DIM                                               !5
         25        OP_DATA                                                  $22
   12    26      > JMP                                                      ->11
         27    >   FE_FREE                                                  $14
   14    28      > FE_RESET_R                                       $23     !0, ->44
         29    > > FE_FETCH_R                                               $23, !6, ->44
   15    30    >   INIT_FCALL                                               'in_array'
         31        INIT_FCALL                                               'substr'
         32        FETCH_DIM_R                                      ~24     !6, 'bd'
         33        SEND_VAL                                                 ~24
         34        SEND_VAL                                                 0
         35        SEND_VAL                                                 5
         36        DO_ICALL                                         $25     
         37        SEND_VAR                                                 $25
         38        SEND_VAR                                                 !5
         39        DO_ICALL                                         $26     
         40      > JMPZ                                                     $26, ->43
         41    >   ASSIGN_DIM                                               !2
         42        OP_DATA                                                  !6
   14    43    > > JMP                                                      ->29
         44    >   FE_FREE                                                  $23
   16    45        INIT_FCALL                                               'print_r'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                                 
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.01 ms | 1400 KiB | 21 Q