3v4l.org

run code in 500+ PHP versions simultaneously
<?php define( 'MINUTE_IN_SECONDS', 60 ); define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); function current_time_61( $gmt_offset ) { return time() + (int) ( $gmt_offset * HOUR_IN_SECONDS ); } function current_time_62( $gmt_offset ) { return time() + ( (int) $gmt_offset * HOUR_IN_SECONDS ); } function current_time_621( $gmt_offset ) { return time() + (int) ( (float) $gmt_offset * HOUR_IN_SECONDS ); } var_dump( current_time_61( 5.5 ) ); var_dump( current_time_62( 5.5 ) ); var_dump( current_time_621( 5.5 ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tgP8m
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'define'
          1        SEND_VAL                                                     'MINUTE_IN_SECONDS'
          2        SEND_VAL                                                     60
          3        DO_ICALL                                                     
    4     4        INIT_FCALL                                                   'define'
          5        SEND_VAL                                                     'HOUR_IN_SECONDS'
          6        FETCH_CONSTANT                                       ~1      'MINUTE_IN_SECONDS'
          7        MUL                                                  ~2      ~1, 60
          8        SEND_VAL                                                     ~2
          9        DO_ICALL                                                     
   18    10        INIT_FCALL                                                   'var_dump'
         11        INIT_FCALL                                                   'current_time_61'
         12        SEND_VAL                                                     5.5
         13        DO_FCALL                                          0  $4      
         14        SEND_VAR                                                     $4
         15        DO_ICALL                                                     
   19    16        INIT_FCALL                                                   'var_dump'
         17        INIT_FCALL                                                   'current_time_62'
         18        SEND_VAL                                                     5.5
         19        DO_FCALL                                          0  $6      
         20        SEND_VAR                                                     $6
         21        DO_ICALL                                                     
   20    22        INIT_FCALL                                                   'var_dump'
         23        INIT_FCALL                                                   'current_time_621'
         24        SEND_VAL                                                     5.5
         25        DO_FCALL                                          0  $8      
         26        SEND_VAR                                                     $8
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Function current_time_61:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tgP8m
function name:  current_time_61
number of ops:  9
compiled vars:  !0 = $gmt_offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        INIT_FCALL                                                   'time'
          2        DO_ICALL                                             $1      
          3        FETCH_CONSTANT                                       ~2      'HOUR_IN_SECONDS'
          4        MUL                                                  ~3      !0, ~2
          5        CAST                                              4  ~4      ~3
          6        ADD                                                  ~5      $1, ~4
          7      > RETURN                                                       ~5
    8     8*     > RETURN                                                       null

End of function current_time_61

Function current_time_62:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tgP8m
function name:  current_time_62
number of ops:  9
compiled vars:  !0 = $gmt_offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   11     1        INIT_FCALL                                                   'time'
          2        DO_ICALL                                             $1      
          3        CAST                                              4  ~2      !0
          4        FETCH_CONSTANT                                       ~3      'HOUR_IN_SECONDS'
          5        MUL                                                  ~4      ~2, ~3
          6        ADD                                                  ~5      $1, ~4
          7      > RETURN                                                       ~5
   12     8*     > RETURN                                                       null

End of function current_time_62

Function current_time_621:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tgP8m
function name:  current_time_621
number of ops:  10
compiled vars:  !0 = $gmt_offset
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   15     1        INIT_FCALL                                                   'time'
          2        DO_ICALL                                             $1      
          3        CAST                                              5  ~2      !0
          4        FETCH_CONSTANT                                       ~3      'HOUR_IN_SECONDS'
          5        MUL                                                  ~4      ~2, ~3
          6        CAST                                              4  ~5      ~4
          7        ADD                                                  ~6      $1, ~5
          8      > RETURN                                                       ~6
   16     9*     > RETURN                                                       null

End of function current_time_621

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.2 ms | 1349 KiB | 19 Q