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 GMT" 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["day"]. " "; //create the "F " part $datemap = array("januari"=>"Jan", "februari"=>"Feb", "maart"=>"Mar", "april"=>"Apr", "mei"=>"May", "juni"=>"Jun", "juli"=>"Jul", "augustus"=>"Aug", "september"=>"Sep", "oktober"=>"Okt", "november"=>"Nov", "december"=>"Dec"); $date .= $datemap[$converted_date["month"]]. " "; //create the "Y " part $date .= $converted_date["year"] . " "; //create the "H:" part if ($converted_date["hour"] == "00"){ $converted_date["hour"] = "23"; } elseif ($converted_date["hour"] == "10"){ $converted_date["hour"] = "09"; } elseif ($converted_date["hour"] == "20"){ $converted_date["hour"] = "19"; } else{ $converted_date["hour"] = substr($converted_date["hour"], 0, 1).(substr($converted_date["hour"], 0, 1) - 1); } $date .= $converted_date["hour"] . ":"; //create the "i:s" part $date .= $converted_date["minute"] .":00 GMT"; echo $date; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 31
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 43
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E1f7u
function name:  (null)
number of ops:  67
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, 'day'
         15        CONCAT                                           ~17     ~16, '+'
         16        ASSIGN_OP                                     8          !3, ~17
   18    17        ASSIGN                                                   !5, <array>
   20    18        FETCH_DIM_R                                      ~20     !1, 'month'
         19        FETCH_DIM_R                                      ~21     !5, ~20
         20        CONCAT                                           ~22     ~21, '+'
         21        ASSIGN_OP                                     8          !3, ~22
   22    22        FETCH_DIM_R                                      ~24     !1, 'year'
         23        CONCAT                                           ~25     ~24, '+'
         24        ASSIGN_OP                                     8          !3, ~25
   24    25        FETCH_DIM_R                                      ~27     !1, 'hour'
         26        IS_EQUAL                                                 ~27, '00'
         27      > JMPZ                                                     ~28, ->31
   25    28    >   ASSIGN_DIM                                               !1, 'hour'
         29        OP_DATA                                                  '23'
         30      > JMP                                                      ->59
   26    31    >   FETCH_DIM_R                                      ~30     !1, 'hour'
         32        IS_EQUAL                                                 ~30, '10'
         33      > JMPZ                                                     ~31, ->37
   27    34    >   ASSIGN_DIM                                               !1, 'hour'
         35        OP_DATA                                                  '09'
         36      > JMP                                                      ->59
   28    37    >   FETCH_DIM_R                                      ~33     !1, 'hour'
         38        IS_EQUAL                                                 ~33, '20'
         39      > JMPZ                                                     ~34, ->43
   29    40    >   ASSIGN_DIM                                               !1, 'hour'
         41        OP_DATA                                                  '19'
         42      > JMP                                                      ->59
   31    43    >   INIT_FCALL                                               'substr'
         44        FETCH_DIM_R                                      ~37     !1, 'hour'
         45        SEND_VAL                                                 ~37
         46        SEND_VAL                                                 0
         47        SEND_VAL                                                 1
         48        DO_ICALL                                         $38     
         49        INIT_FCALL                                               'substr'
         50        FETCH_DIM_R                                      ~39     !1, 'hour'
         51        SEND_VAL                                                 ~39
         52        SEND_VAL                                                 0
         53        SEND_VAL                                                 1
         54        DO_ICALL                                         $40     
         55        SUB                                              ~41     $40, 1
         56        CONCAT                                           ~42     $38, ~41
         57        ASSIGN_DIM                                               !1, 'hour'
         58        OP_DATA                                                  ~42
   33    59    >   FETCH_DIM_R                                      ~43     !1, 'hour'
         60        CONCAT                                           ~44     ~43, '%3A'
         61        ASSIGN_OP                                     8          !3, ~44
   35    62        FETCH_DIM_R                                      ~46     !1, 'minute'
         63        CONCAT                                           ~47     ~46, '%3A00+GMT'
         64        ASSIGN_OP                                     8          !3, ~47
   36    65        ECHO                                                     !3
   37    66      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.47 ms | 1400 KiB | 17 Q