3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [["id" => 100, "data" => "21-11-2013"]]; $arr = [["id" => 100, "data" => "21AAA111"]]; foreach($arr as $k => &$e) { $val = strtotime($e["data"]) ? strtotime($e["data"]) : strtotime(str_replace("/", "-", $e["data"])); $e["data"] = date("m/d/y", $val); if (!$val) unset($arr[$k]); } print_r($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 37
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 37
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 36
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
Branch analysis from position: 36
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/MeOeY
function name:  (null)
number of ops:  42
compiled vars:  !0 = $arr, !1 = $e, !2 = $k, !3 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !0, <array>
    6     2      > FE_RESET_RW                                      $6      !0, ->37
          3    > > FE_FETCH_RW                                      ~7      $6, !1, ->37
          4    >   ASSIGN                                                   !2, ~7
    7     5        INIT_FCALL                                               'strtotime'
          6        FETCH_DIM_R                                      ~9      !1, 'data'
          7        SEND_VAL                                                 ~9
          8        DO_ICALL                                         $10     
          9      > JMPZ                                                     $10, ->16
         10    >   INIT_FCALL                                               'strtotime'
         11        FETCH_DIM_R                                      ~11     !1, 'data'
         12        SEND_VAL                                                 ~11
         13        DO_ICALL                                         $12     
         14        QM_ASSIGN                                        ~13     $12
         15      > JMP                                                      ->26
         16    >   INIT_FCALL                                               'strtotime'
         17        INIT_FCALL                                               'str_replace'
         18        SEND_VAL                                                 '%2F'
         19        SEND_VAL                                                 '-'
         20        FETCH_DIM_R                                      ~14     !1, 'data'
         21        SEND_VAL                                                 ~14
         22        DO_ICALL                                         $15     
         23        SEND_VAR                                                 $15
         24        DO_ICALL                                         $16     
         25        QM_ASSIGN                                        ~13     $16
         26    >   ASSIGN                                                   !3, ~13
    8    27        INIT_FCALL                                               'date'
         28        SEND_VAL                                                 'm%2Fd%2Fy'
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                         $19     
         31        ASSIGN_DIM                                               !1, 'data'
         32        OP_DATA                                                  $19
    9    33        BOOL_NOT                                         ~20     !3
         34      > JMPZ                                                     ~20, ->36
         35    >   UNSET_DIM                                                !0, !2
    6    36    > > JMP                                                      ->3
         37    >   FE_FREE                                                  $6
   14    38        INIT_FCALL                                               'print_r'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.28 ms | 1008 KiB | 17 Q