3v4l.org

run code in 500+ PHP versions simultaneously
<?php $start_date2='10-30-2022'; //date format inccorect $start_date2=str_replace('-','/',$start_date2); // correct date format echo $new_date = date("Y-m-d", strtotime($start_date2)); // now you will get correct result
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQHHA
function name:  (null)
number of ops:  14
compiled vars:  !0 = $start_date2, !1 = $new_date
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '10-30-2022'
    4     1        FRAMELESS_ICALL_3                str_replace         ~3      '-', '%2F'
          2        OP_DATA                                                      !0
          3        ASSIGN                                                       !0, ~3
    5     4        INIT_FCALL                                                   'date'
          5        SEND_VAL                                                     'Y-m-d'
          6        INIT_FCALL                                                   'strtotime'
          7        SEND_VAR                                                     !0
          8        DO_ICALL                                             $5      
          9        SEND_VAR                                                     $5
         10        DO_ICALL                                             $6      
         11        ASSIGN                                               ~7      !1, $6
         12        ECHO                                                         ~7
         13      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.89 ms | 1879 KiB | 15 Q