3v4l.org

run code in 300+ PHP versions simultaneously
<?php function format($timezone) { $d = new \DateTime('now', new \DateTimeZone($timezone)); return $d->format('Y-m-d H:i:s.u ' . $d->getTimeZone()->getLocation() ? 'e (P)' : 'P'); } echo format('Europe/Paris') . PHP_EOL; echo format('UTC') . PHP_EOL; echo format('+02:00') . PHP_EOL; echo format('GMT+2') . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yo88W
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'format'
          1        SEND_VAL                                                 'Europe%2FParis'
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      $0, '%0A'
          4        ECHO                                                     ~1
   11     5        INIT_FCALL                                               'format'
          6        SEND_VAL                                                 'UTC'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      $2, '%0A'
          9        ECHO                                                     ~3
   12    10        INIT_FCALL                                               'format'
         11        SEND_VAL                                                 '%2B02%3A00'
         12        DO_FCALL                                      0  $4      
         13        CONCAT                                           ~5      $4, '%0A'
         14        ECHO                                                     ~5
   13    15        INIT_FCALL                                               'format'
         16        SEND_VAL                                                 'GMT%2B2'
         17        DO_FCALL                                      0  $6      
         18        CONCAT                                           ~7      $6, '%0A'
         19        ECHO                                                     ~7
         20      > RETURN                                                   1

Function format:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Yo88W
function name:  format
number of ops:  23
compiled vars:  !0 = $timezone, !1 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        NEW                                              $2      'DateTime'
          2        SEND_VAL_EX                                              'now'
          3        NEW                                              $3      'DateTimeZone'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $3
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $2
    7     9        INIT_METHOD_CALL                                         !1, 'format'
         10        INIT_METHOD_CALL                                         !1, 'getTimeZone'
         11        DO_FCALL                                      0  $7      
         12        INIT_METHOD_CALL                                         $7, 'getLocation'
         13        DO_FCALL                                      0  $8      
         14        CONCAT                                           ~9      'Y-m-d+H%3Ai%3As.u+', $8
         15      > JMPZ                                                     ~9, ->18
         16    >   QM_ASSIGN                                        ~10     'e+%28P%29'
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~10     'P'
         19    >   SEND_VAL_EX                                              ~10
         20        DO_FCALL                                      0  $11     
         21      > RETURN                                                   $11
    8    22*     > RETURN                                                   null

End of function format

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.7 ms | 1407 KiB | 17 Q