3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = '01-2018'; $dateTime = new DateTime(preg_replace('~^(\d\d)-(\d\d\d\d)$~','$2W$1',$str)); var_dump($dateTime);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mo6dQ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str, !1 = $dateTime
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '01-2018'
    5     1        NEW                                                  $3      'DateTime'
          2        FRAMELESS_ICALL_3                preg_replace        ~4      '%7E%5E%28%5Cd%5Cd%29-%28%5Cd%5Cd%5Cd%5Cd%29%24%7E', '%242W%241'
          3        OP_DATA                                                      !0
          4        SEND_VAL_EX                                                  ~4
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !1, $3
    7     7        INIT_FCALL                                                   'var_dump'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                                     
         10      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.64 ms | 1879 KiB | 16 Q