3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dutch_date = "donderdag 27 maart 2014 00:30"; $converted_date = array(); $pattern = "#(?P<day_of_the_week>\w+)\ (?P<day>\d+)\ (?P<month>\w+)\ (?P<year>\d+)\ (?P<hour>\d+):(?P<minute>\d+)#s"; preg_match($pattern,$dutch_date, $converted_date); $date = ""; $date .= $converted_date["year"] . "-"; $datemap = array("januari"=>"01", "februari"=>"02", "maart"=>"03", "april"=>"04", "mei"=>"05", "juni"=>"06", "juli"=>"07", "augustus"=>"08", "september"=>"09", "oktober"=>"10", "november"=>"11", "december"=>"12"); $date .= $datemap[$converted_date["month"]]. "-"; $date .= $converted_date["day"]. " "; $date .= $converted_date["hour"] . ":"; $date .= $converted_date["minute"] .":00"; $format = 'Y-m-d H:i:s'; $date = DateTime::createFromFormat($format, $date); print_r($date); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lF1TH
function name:  (null)
number of ops:  36
compiled vars:  !0 = $dutch_date, !1 = $converted_date, !2 = $pattern, !3 = $date, !4 = $datemap, !5 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'donderdag+27+maart+2014+00%3A30'
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, '%23%28%3FP%3Cday_of_the_week%3E%5Cw%2B%29%5C+%28%3FP%3Cday%3E%5Cd%2B%29%5C+%28%3FP%3Cmonth%3E%5Cw%2B%29%5C+%28%3FP%3Cyear%3E%5Cd%2B%29%5C+%28%3FP%3Chour%3E%5Cd%2B%29%3A%28%3FP%3Cminute%3E%5Cd%2B%29%23s'
    6     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !1
          7        DO_ICALL                                                 
    7     8        ASSIGN                                                   !3, ''
    8     9        FETCH_DIM_R                                      ~11     !1, 'year'
         10        CONCAT                                           ~12     ~11, '-'
         11        ASSIGN_OP                                     8          !3, ~12
    9    12        ASSIGN                                                   !4, <array>
   11    13        FETCH_DIM_R                                      ~15     !1, 'month'
         14        FETCH_DIM_R                                      ~16     !4, ~15
         15        CONCAT                                           ~17     ~16, '-'
         16        ASSIGN_OP                                     8          !3, ~17
   12    17        FETCH_DIM_R                                      ~19     !1, 'day'
         18        CONCAT                                           ~20     ~19, '+'
         19        ASSIGN_OP                                     8          !3, ~20
   13    20        FETCH_DIM_R                                      ~22     !1, 'hour'
         21        CONCAT                                           ~23     ~22, '%3A'
         22        ASSIGN_OP                                     8          !3, ~23
   14    23        FETCH_DIM_R                                      ~25     !1, 'minute'
         24        CONCAT                                           ~26     ~25, '%3A00'
         25        ASSIGN_OP                                     8          !3, ~26
   15    26        ASSIGN                                                   !5, 'Y-m-d+H%3Ai%3As'
   16    27        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         28        SEND_VAR                                                 !5
         29        SEND_VAR                                                 !3
         30        DO_FCALL                                      0  $29     
         31        ASSIGN                                                   !3, $29
   17    32        INIT_FCALL                                               'print_r'
         33        SEND_VAR                                                 !3
         34        DO_ICALL                                                 
   18    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.71 ms | 1388 KiB | 17 Q