3v4l.org

run code in 300+ PHP versions simultaneously
<?php //the dutch date $dutch_date = "donderdag 27 maart 2014 00:30"; //split it in usable parts $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); //create the empty date, we'll store our date in this variable in "D, d F Y H:i:s" format $date = ""; //create the "D, "-part $daymap = array("maandag" => "Mon", "dinsdag"=>"Tue", "woensdag"=>"Wed", "donderdag"=>"Thu", "vrijdag"=>"Fri", "zaterdag"=>"Sat", "zondag"=>"Sun"); $date .= $daymap[$converted_date["day_of_the_week"]].", "; //create the "d " part $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"; echo $date; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dsTHD
function name:  (null)
number of ops:  33
compiled vars:  !0 = $dutch_date, !1 = $converted_date, !2 = $pattern, !3 = $date, !4 = $daymap, !5 = $datemap
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'donderdag+27+maart+2014+00%3A30'
    6     1        ASSIGN                                                   !1, <array>
    7     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'
    8     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !1
          7        DO_ICALL                                                 
   10     8        ASSIGN                                                   !3, ''
   12     9        ASSIGN                                                   !4, <array>
   14    10        FETCH_DIM_R                                      ~12     !1, 'day_of_the_week'
         11        FETCH_DIM_R                                      ~13     !4, ~12
         12        CONCAT                                           ~14     ~13, '%2C+'
         13        ASSIGN_OP                                     8          !3, ~14
   16    14        FETCH_DIM_R                                      ~16     !1, 'year'
         15        CONCAT                                           ~17     ~16, '-'
         16        ASSIGN_OP                                     8          !3, ~17
   17    17        ASSIGN                                                   !5, <array>
   19    18        FETCH_DIM_R                                      ~20     !1, 'month'
         19        FETCH_DIM_R                                      ~21     !5, ~20
         20        CONCAT                                           ~22     ~21, '-'
         21        ASSIGN_OP                                     8          !3, ~22
   20    22        FETCH_DIM_R                                      ~24     !1, 'day'
         23        CONCAT                                           ~25     ~24, '+'
         24        ASSIGN_OP                                     8          !3, ~25
   21    25        FETCH_DIM_R                                      ~27     !1, 'hour'
         26        CONCAT                                           ~28     ~27, '%3A'
         27        ASSIGN_OP                                     8          !3, ~28
   22    28        FETCH_DIM_R                                      ~30     !1, 'minute'
         29        CONCAT                                           ~31     ~30, '%3A00'
         30        ASSIGN_OP                                     8          !3, ~31
   23    31        ECHO                                                     !3
   24    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.33 ms | 1396 KiB | 15 Q