3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class Rfc7231Formatter { public static function format(DateTimeImmutable $dt): string { return $dt->setTimezone(new DateTimeZone('GMT'))->format('D, d M Y H:i:s') . ' GMT'; } } echo Rfc7231Formatter::format(new DateTimeImmutable('2026-01-21 12:23:34.567890+01:00')); echo PHP_EOL; echo Rfc7231Formatter::format(new DateTimeImmutable('2026-01-21 12:23:34.567890-08:00'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZv34
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                      'Rfc7231Formatter', 'format'
          1        NEW                                                  $0      'DateTimeImmutable'
          2        SEND_VAL_EX                                                  '2026-01-21+12%3A23%3A34.567890%2B01%3A00'
          3        DO_FCALL                                          0          
          4        SEND_VAR                                                     $0
          5        DO_FCALL                                          0  $2      
          6        ECHO                                                         $2
   12     7        ECHO                                                         '%0A'
   13     8        INIT_STATIC_METHOD_CALL                                      'Rfc7231Formatter', 'format'
          9        NEW                                                  $3      'DateTimeImmutable'
         10        SEND_VAL_EX                                                  '2026-01-21+12%3A23%3A34.567890-08%3A00'
         11        DO_FCALL                                          0          
         12        SEND_VAR                                                     $3
         13        DO_FCALL                                          0  $5      
         14        ECHO                                                         $5
         15      > RETURN                                                       1

Class Rfc7231Formatter:
Function format:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZv34
function name:  format
number of ops:  15
compiled vars:  !0 = $dt
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
    7     1        INIT_METHOD_CALL                                             !0, 'setTimezone'
          2        NEW                                                  $1      'DateTimeZone'
          3        SEND_VAL_EX                                                  'GMT'
          4        DO_FCALL                                          0          
          5        SEND_VAR_NO_REF_EX                                           $1
          6        DO_FCALL                                          0  $3      
          7        INIT_METHOD_CALL                                             $3, 'format'
          8        SEND_VAL_EX                                                  'D%2C+d+M+Y+H%3Ai%3As'
          9        DO_FCALL                                          0  $4      
         10        CONCAT                                               ~5      $4, '+GMT'
         11        VERIFY_RETURN_TYPE                                           ~5
         12      > RETURN                                                       ~5
    8    13*       VERIFY_RETURN_TYPE                                           
         14*     > RETURN                                                       null

End of function format

End of class Rfc7231Formatter.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.37 ms | 1143 KiB | 13 Q