3v4l.org

run code in 300+ PHP versions simultaneously
<?php function timeZoneToOffset(string $timeZone): \DateTimeImmutable { return new DateTimeImmutable( '2020-01-01 15:00' . (new \DateTime('now', new DateTimeZone($timeZone)))->format('P') ); } var_dump(timeZoneToOffset('Europe/Paris')->getTimestamp() === timeZoneToOffset('Africa/Cairo')->getTimestamp());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ta4a8
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'timezonetooffset'
          2        SEND_VAL                                                 'Europe%2FParis'
          3        DO_FCALL                                      0  $0      
          4        INIT_METHOD_CALL                                         $0, 'getTimestamp'
          5        DO_FCALL                                      0  $1      
          6        INIT_FCALL                                               'timezonetooffset'
          7        SEND_VAL                                                 'Africa%2FCairo'
          8        DO_FCALL                                      0  $2      
          9        INIT_METHOD_CALL                                         $2, 'getTimestamp'
         10        DO_FCALL                                      0  $3      
         11        IS_IDENTICAL                                     ~4      $1, $3
         12        SEND_VAL                                                 ~4
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function timezonetooffset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ta4a8
function name:  timeZoneToOffset
number of ops:  19
compiled vars:  !0 = $timeZone
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        NEW                                              $1      'DateTimeImmutable'
    5     2        NEW                                              $2      'DateTime'
          3        SEND_VAL_EX                                              'now'
          4        NEW                                              $3      'DateTimeZone'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $3
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $2, 'format'
         10        SEND_VAL_EX                                              'P'
         11        DO_FCALL                                      0  $6      
         12        CONCAT                                           ~7      '2020-01-01+15%3A00', $6
         13        SEND_VAL_EX                                              ~7
         14        DO_FCALL                                      0          
         15        VERIFY_RETURN_TYPE                                       $1
         16      > RETURN                                                   $1
    7    17*       VERIFY_RETURN_TYPE                                       
         18*     > RETURN                                                   null

End of function timezonetooffset

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.69 ms | 1399 KiB | 17 Q