3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dev_id = 1; $dates = ['04 Mar 15', '14 Apr 15', '27 Aug 15']; $format_dates = []; $insert_dates = ""; foreach($dates as $raw_date) { $str_to_date = DateTime::createFromFormat('d M y', $raw_date); $format_dates[] = $str_to_date->format('Y-m-d'); } $date_array = new ArrayIterator($format_dates); $c_date_array = new CachingIterator($date_array); foreach($c_date_array as $date) { $insert_dates .= "($date, $dev_id)"; if ($c_date_array->hasNext()) { $insert_dates .= ", "; } } echo $insert_dates; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 39
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 39
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 38
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 38
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
Branch analysis from position: 17
filename:       /in/ko7dH
function name:  (null)
number of ops:  42
compiled vars:  !0 = $dev_id, !1 = $dates, !2 = $format_dates, !3 = $insert_dates, !4 = $raw_date, !5 = $str_to_date, !6 = $date_array, !7 = $c_date_array, !8 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
    3     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, ''
    7     4      > FE_RESET_R                                       $13     !1, ->17
          5    > > FE_FETCH_R                                               $13, !4, ->17
    8     6    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          7        SEND_VAL                                                 'd+M+y'
          8        SEND_VAR                                                 !4
          9        DO_FCALL                                      0  $14     
         10        ASSIGN                                                   !5, $14
    9    11        INIT_METHOD_CALL                                         !5, 'format'
         12        SEND_VAL_EX                                              'Y-m-d'
         13        DO_FCALL                                      0  $17     
         14        ASSIGN_DIM                                               !2
         15        OP_DATA                                                  $17
    7    16      > JMP                                                      ->5
         17    >   FE_FREE                                                  $13
   12    18        NEW                                              $18     'ArrayIterator'
         19        SEND_VAR_EX                                              !2
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !6, $18
   13    22        NEW                                              $21     'CachingIterator'
         23        SEND_VAR_EX                                              !6
         24        DO_FCALL                                      0          
         25        ASSIGN                                                   !7, $21
   15    26      > FE_RESET_R                                       $24     !7, ->39
         27    > > FE_FETCH_R                                               $24, !8, ->39
   16    28    >   ROPE_INIT                                     5  ~26     '%28'
         29        ROPE_ADD                                      1  ~26     ~26, !8
         30        ROPE_ADD                                      2  ~26     ~26, '%2C+'
         31        ROPE_ADD                                      3  ~26     ~26, !0
         32        ROPE_END                                      4  ~25     ~26, '%29'
         33        ASSIGN_OP                                     8          !3, ~25
   17    34        INIT_METHOD_CALL                                         !7, 'hasNext'
         35        DO_FCALL                                      0  $30     
         36      > JMPZ                                                     $30, ->38
   18    37    >   ASSIGN_OP                                     8          !3, '%2C+'
   15    38    > > JMP                                                      ->27
         39    >   FE_FREE                                                  $24
   22    40        ECHO                                                     !3
   23    41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152 ms | 1399 KiB | 13 Q