3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Client { const SOLR_TIMEZONE = 'Zulu'; const SOLR_DATEFORMAT = 'Y-m-d\TG:i:s\Z'; public static function formatToSolrFormat(\DateTime $date) { $date = clone $date; $date->setTimezone(new \DateTimeZone(self::SOLR_TIMEZONE)); return $date->format(self::SOLR_DATEFORMAT); } } echo Client::formatToSolrFormat(new \DateTime());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tErb8
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'Client', 'formatToSolrFormat'
          1        NEW                                              $0      'DateTime'
          2        DO_FCALL                                      0          
          3        SEND_VAR                                                 $0
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Class Client:
Function formattosolrformat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tErb8
function name:  formatToSolrFormat
number of ops:  14
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        CLONE                                            ~1      !0
          2        ASSIGN                                                   !0, ~1
   11     3        INIT_METHOD_CALL                                         !0, 'setTimezone'
          4        NEW                                              $3      'DateTimeZone'
          5        SEND_VAL_EX                                              'Zulu'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $3
          8        DO_FCALL                                      0          
   13     9        INIT_METHOD_CALL                                         !0, 'format'
         10        SEND_VAL_EX                                              'Y-m-d%5CTG%3Ai%3As%5CZ'
         11        DO_FCALL                                      0  $6      
         12      > RETURN                                                   $6
   14    13*     > RETURN                                                   null

End of function formattosolrformat

End of class Client.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.17 ms | 1394 KiB | 13 Q