3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( 0 => array ( 'ID' => '1', 'link' => 'example.com/link', 'description' => 'that\'s a description', 'eventDate' => '2020-04-07 01:04:25', ), 1 => array ( 'ID' => '6', 'link' => 'example.com/link', 'description' => 'that\'s a description', 'eventDate' => '2020-04-15 00:00:00', ), 2 => array ( 'ID' => '7', 'link' => 'example.com/link', 'description' => 'that\'s a description', 'eventDate' => '2020-04-16 07:24:11', ), 3 => array ( 'ID' => '8', 'link' => 'example.com/link', 'description' => 'that\'s a description', 'eventDate' => '2020-04-26 07:07:10', ), ); $events = array(); foreach ($data as $event) { $events[date('Y-m-d', strtotime($event['eventDate']))] = array( 'text' => $event['description'], 'href' => $event['link'] ); } var_export($events);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/tGnLa
function name:  (null)
number of ops:  24
compiled vars:  !0 = $data, !1 = $events, !2 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   36     1        ASSIGN                                                   !1, <array>
   37     2      > FE_RESET_R                                       $5      !0, ->19
          3    > > FE_FETCH_R                                               $5, !2, ->19
   38     4    >   INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'Y-m-d'
          6        INIT_FCALL                                               'strtotime'
          7        FETCH_DIM_R                                      ~6      !2, 'eventDate'
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                         $8      
   39    12        FETCH_DIM_R                                      ~10     !2, 'description'
         13        INIT_ARRAY                                       ~11     ~10, 'text'
   40    14        FETCH_DIM_R                                      ~12     !2, 'link'
         15        ADD_ARRAY_ELEMENT                                ~11     ~12, 'href'
   38    16        ASSIGN_DIM                                               !1, $8
   40    17        OP_DATA                                                  ~11
   37    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $5
   43    20        INIT_FCALL                                               'var_export'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
270.83 ms | 1012 KiB | 16 Q