3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array("2017-06-06 13:04:50", "2017-06-06 13:09:54", "2017-06-06 13:20:20", "2017-06-06 13:40:29", "2017-06-06 14:05:30", "2017-06-06 14:12:50", "2017-06-06 14:30:40", "2017-06-06 15:01:36", "2017-06-06 15:06:16"); Foreach($arr as $val){ $newarr[] = date("Y-m-d H", strtotime($val)); } Var_dump($newarr); Var_dump(array_count_values($newarr));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/690ne
function name:  (null)
number of ops:  24
compiled vars:  !0 = $arr, !1 = $val, !2 = $newarr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1      > FE_RESET_R                                       $4      !0, ->13
          2    > > FE_FETCH_R                                               $4, !1, ->13
   14     3    >   INIT_FCALL                                               'date'
          4        SEND_VAL                                                 'Y-m-d+H'
          5        INIT_FCALL                                               'strtotime'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                         $7      
         10        ASSIGN_DIM                                               !2
         11        OP_DATA                                                  $7
   13    12      > JMP                                                      ->2
         13    >   FE_FREE                                                  $4
   17    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
   19    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'array_count_values'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $9      
         21        SEND_VAR                                                 $9
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.66 ms | 1013 KiB | 17 Q