3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 0 => '2014-06-01 12:45:02' ,1 => '2014-06-01 12:45:03' ,2 => '2014-06-01 12:48:52' ,3 => '2014-06-01 12:50:31' ,4 => '2014-06-01 13:18:49' ,10 => '2014-06-01 13:33:16' ,11 => '2014-06-01 14:20:48' ,12 => '2014-06-01 14:24:44' ,13 => '2014-06-01 15:28:16' ,14 => '2014-06-02 10:50:56' ,15 => '2014-06-02 10:51:07' ,16 => '2014-06-02 18:16:13' ,17 => '2014-06-03 11:20:20' ,18 => '2014-06-03 11:58:46' ,19 => '2014-06-03 11:59:03' ,20 => '2014-06-03 12:00:51' ,21 => '2014-06-03 12:01:21' ,22 => '2014-06-04 19:03:17' ,23 => '2014-06-04 19:06:03' ,24 => '2014-06-04 19:12:03' ,25 => '2014-06-04 21:18:03' ); $start = microtime(true); $new_array = array_map(function($x){return date('Y-m-d', strtotime($x));}, $array); $end = microtime(true); echo $end - $start . "\n"; $start = microtime(true); $new_array = array(); foreach($array as $arr) { $new_array[] = date('Y-m-d', strtotime($arr)); } $end = microtime(true); echo $end - $start . "\n"; //print_r(array_count_values($new_array));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 35
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 35
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/EDeJg
function name:  (null)
number of ops:  44
compiled vars:  !0 = $array, !1 = $start, !2 = $new_array, !3 = $end, !4 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   27     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
   28     5        INIT_FCALL                                               'array_map'
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FEDeJg%3A28%240'
          7        SEND_VAL                                                 ~8
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !2, $9
   29    11        INIT_FCALL                                               'microtime'
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !3, $11
   30    15        SUB                                              ~13     !3, !1
         16        CONCAT                                           ~14     ~13, '%0A'
         17        ECHO                                                     ~14
   32    18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $15     
         21        ASSIGN                                                   !1, $15
   33    22        ASSIGN                                                   !2, <array>
   34    23      > FE_RESET_R                                       $18     !0, ->35
         24    > > FE_FETCH_R                                               $18, !4, ->35
   35    25    >   INIT_FCALL                                               'date'
         26        SEND_VAL                                                 'Y-m-d'
         27        INIT_FCALL                                               'strtotime'
         28        SEND_VAR                                                 !4
         29        DO_ICALL                                         $20     
         30        SEND_VAR                                                 $20
         31        DO_ICALL                                         $21     
         32        ASSIGN_DIM                                               !2
         33        OP_DATA                                                  $21
   34    34      > JMP                                                      ->24
         35    >   FE_FREE                                                  $18
   37    36        INIT_FCALL                                               'microtime'
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $22     
         39        ASSIGN                                                   !3, $22
   38    40        SUB                                              ~24     !3, !1
         41        CONCAT                                           ~25     ~24, '%0A'
         42        ECHO                                                     ~25
   41    43      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FEDeJg%3A28%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EDeJg
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'Y-m-d'
          3        INIT_FCALL                                               'strtotime'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
          9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FEDeJg%3A28%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.89 ms | 1400 KiB | 21 Q