3v4l.org

run code in 500+ PHP versions simultaneously
<?php $contacts = [["createdAt"=>'2020-01-29T17:00:04.159+01:00']]; foreach ($contacts as &$contact) { $time = new DateTime($contact['createdAt']); $contact['createdAt'] = $time->format('Y-m-d'); } print_r($contacts);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 15
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/tNjq6
function name:  (null)
number of ops:  20
compiled vars:  !0 = $contacts, !1 = $contact, !2 = $time
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
    4     1      > FE_RESET_RW                                          $4      !0, ->15
          2    > > FE_FETCH_RW                                                  $4, !1, ->15
    6     3    >   NEW                                                  $5      'DateTime'
          4        CHECK_FUNC_ARG                                               
          5        FETCH_DIM_FUNC_ARG                                   $6      !1, 'createdAt'
          6        SEND_FUNC_ARG                                                $6
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !2, $5
    7     9        INIT_METHOD_CALL                                             !2, 'format'
         10        SEND_VAL_EX                                                  'Y-m-d'
         11        DO_FCALL                                          0  $10     
         12        ASSIGN_DIM                                                   !1, 'createdAt'
         13        OP_DATA                                                      $10
    4    14      > JMP                                                          ->2
         15    >   FE_FREE                                                      $4
   10    16        INIT_FCALL                                                   'print_r'
         17        SEND_VAR                                                     !0
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
207.06 ms | 2093 KiB | 13 Q