3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link https://stackoverflow.com/a/13129856/367456 */ $formats = array( 'today midnight', 'midnight', 'today', 'TODAY', 'MidNight', 'ToDaY', 'tomorrow', 'UTC today', 'today Z', 'today Europe/Berlin', 'Asia/Shanghai today', 'Asia/Shanghai', 'HKST today', ); $time = strtotime('UTC 2020-01-01 00:00:00'); printf("UTC time is: %d (script-time, is UTC 2020-01-01 00:00:00)\n", $time); if (is_callable('date_default_timezone_get')) { printf("default time-zone is: %s\n", date_default_timezone_get()); } else { printf("default time-zone is: %s\n", '???'); } foreach ($formats as $format) { printf("%'.-24s: %s\n", "$format ", strtotime($format, $time)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 20
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 38
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
Branch analysis from position: 38
filename:       /in/amfGc
function name:  (null)
number of ops:  40
compiled vars:  !0 = $formats, !1 = $time, !2 = $format
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   7     0  E >   ASSIGN                                                   !0, <array>
  22     1        INIT_FCALL                                               'strtotime'
         2        SEND_VAL                                                 'UTC+2020-01-01+00%3A00%3A00'
         3        DO_ICALL                                         $4      
         4        ASSIGN                                                   !1, $4
  24     5        INIT_FCALL                                               'printf'
         6        SEND_VAL                                                 'UTC+time+is%3A+%25d+%28script-time%2C+is+UTC+2020-01-01+00%3A00%3A00%29%0A'
         7        SEND_VAR                                                 !1
         8        DO_ICALL                                                 
  25     9        INIT_FCALL                                               'is_callable'
        10        SEND_VAL                                                 'date_default_timezone_get'
        11        DO_ICALL                                         $7      
        12      > JMPZ                                                     $7, ->20
  26    13    >   INIT_FCALL                                               'printf'
        14        SEND_VAL                                                 'default+time-zone+is%3A+%25s%0A'
        15        INIT_FCALL                                               'date_default_timezone_get'
        16        DO_ICALL                                         $8      
        17        SEND_VAR                                                 $8
        18        DO_ICALL                                                 
        19      > JMP                                                      ->24
  28    20    >   INIT_FCALL                                               'printf'
        21        SEND_VAL                                                 'default+time-zone+is%3A+%25s%0A'
        22        SEND_VAL                                                 '%3F%3F%3F'
        23        DO_ICALL                                                 
  30    24    > > FE_RESET_R                                       $11     !0, ->38
        25    > > FE_FETCH_R                                               $11, !2, ->38
  31    26    >   INIT_FCALL                                               'printf'
        27        SEND_VAL                                                 '%25%27.-24s%3A+%25s%0A'
        28        NOP                                                      
        29        FAST_CONCAT                                      ~12     !2, '+'
        30        SEND_VAL                                                 ~12
        31        INIT_FCALL                                               'strtotime'
        32        SEND_VAR                                                 !2
        33        SEND_VAR                                                 !1
        34        DO_ICALL                                         $13     
        35        SEND_VAR                                                 $13
        36        DO_ICALL                                                 
  30    37      > JMP                                                      ->25
        38    >   FE_FREE                                                  $11
  32    39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
14.12 ms | 416 KiB | 7 Q