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; $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 = 10, Position 2 = 26
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 26
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 26
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 43
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 43
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 42
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
Branch analysis from position: 26
filename:       /in/J1N3v
function name:  (null)
number of ops:  48
compiled vars:  !0 = $workers, !1 = $days, !2 = $date, !3 = $i, !4 = $holydays, !5 = $worker, !6 = $holy_workers
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 10
   10     2        NEW                                              $9      'DateTimeImmutable'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $9
   11     5        INIT_FCALL                                               'range'
          6        SEND_VAL                                                 0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $12     
          9      > FE_RESET_R                                       $13     $12, ->26
         10    > > FE_FETCH_R                                               $13, !3, ->26
   12    11    >   INIT_METHOD_CALL                                         !2, 'add'
         12        NEW                                              $15     'DateInterval'
         13        ROPE_INIT                                     3  ~17     'P'
         14        ROPE_ADD                                      1  ~17     ~17, !3
         15        ROPE_END                                      2  ~16     ~17, 'D'
         16        SEND_VAL_EX                                              ~16
         17        DO_FCALL                                      0          
         18        SEND_VAR_NO_REF_EX                                       $15
         19        DO_FCALL                                      0  $20     
         20        INIT_METHOD_CALL                                         $20, 'format'
         21        SEND_VAL_EX                                              'd.m'
         22        DO_FCALL                                      0  $21     
         23        ASSIGN_DIM                                               !4
         24        OP_DATA                                                  $21
   11    25      > JMP                                                      ->10
         26    >   FE_FREE                                                  $13
   13    27      > FE_RESET_R                                       $22     !0, ->43
         28    > > FE_FETCH_R                                               $22, !5, ->43
   14    29    >   INIT_FCALL                                               'in_array'
         30        INIT_FCALL                                               'substr'
         31        FETCH_DIM_R                                      ~23     !5, 'bd'
         32        SEND_VAL                                                 ~23
         33        SEND_VAL                                                 0
         34        SEND_VAL                                                 5
         35        DO_ICALL                                         $24     
         36        SEND_VAR                                                 $24
         37        SEND_VAR                                                 !4
         38        DO_ICALL                                         $25     
         39      > JMPZ                                                     $25, ->42
         40    >   ASSIGN_DIM                                               !6
         41        OP_DATA                                                  !5
   13    42    > > JMP                                                      ->28
         43    >   FE_FREE                                                  $22
   15    44        INIT_FCALL                                               'print_r'
         45        SEND_VAR                                                 !6
         46        DO_ICALL                                                 
         47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.5 ms | 1400 KiB | 21 Q