3v4l.org

run code in 500+ PHP versions simultaneously
<?php $avaDates = [ ['date_starts' => '2024-03-01'], ['date_starts' => '2024-03-09'], ['date_starts' => '2024-04-05'], ['date_starts' => '2024-04-09'], ['date_starts' => '2024-04-15'], ['date_starts' => '2024-05-03'] ]; $cached = null; $count = 0; foreach($avaDates as ['date_starts' => $d]) { $FY = date("F-Y", strtotime($d)); if ($cached !== $FY) { if ($cached !== null) { echo " $count\n"; $count = 0; } echo strtolower($FY); } $cached = $FY; ++$count; } if ($count) { echo " $count"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 32
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 29
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 25
Branch analysis from position: 29
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
Branch analysis from position: 32
filename:       /in/kiRQC
function name:  (null)
number of ops:  38
compiled vars:  !0 = $avaDates, !1 = $cached, !2 = $count, !3 = $d, !4 = $FY
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   12     1        ASSIGN                                                       !1, null
   13     2        ASSIGN                                                       !2, 0
   14     3      > FE_RESET_R                                           $8      !0, ->32
          4    > > FE_FETCH_R                                                   $8, $9, ->32
          5    >   FETCH_LIST_R                                         $10     $9, 'date_starts'
          6        ASSIGN                                                       !3, $10
          7        FREE                                                         $9
   15     8        INIT_FCALL                                                   'date'
          9        SEND_VAL                                                     'F-Y'
         10        INIT_FCALL                                                   'strtotime'
         11        SEND_VAR                                                     !3
         12        DO_ICALL                                             $12     
         13        SEND_VAR                                                     $12
         14        DO_ICALL                                             $13     
         15        ASSIGN                                                       !4, $13
   16    16        IS_NOT_IDENTICAL                                             !1, !4
         17      > JMPZ                                                         ~15, ->29
   17    18    >   TYPE_CHECK                                      1020          !1
         19      > JMPZ                                                         ~16, ->25
   18    20    >   ROPE_INIT                                         3  ~18     '+'
         21        ROPE_ADD                                          1  ~18     ~18, !2
         22        ROPE_END                                          2  ~17     ~18, '%0A'
         23        ECHO                                                         ~17
   19    24        ASSIGN                                                       !2, 0
   21    25    >   INIT_FCALL                                                   'strtolower'
         26        SEND_VAR                                                     !4
         27        DO_ICALL                                             $21     
         28        ECHO                                                         $21
   23    29    >   ASSIGN                                                       !1, !4
   24    30        PRE_INC                                                      !2
   14    31      > JMP                                                          ->4
         32    >   FE_FREE                                                      $8
   26    33      > JMPZ                                                         !2, ->37
   27    34    >   NOP                                                          
         35        FAST_CONCAT                                          ~24     '+', !2
         36        ECHO                                                         ~24
   28    37    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.21 ms | 1594 KiB | 16 Q