3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GetFormattedMicroTime($timestamp = false) { if(!$timestamp) $timestamp = microtime(true); return DateTime::createFromFormat('U.u',sprintf('%.f', $timestamp))->format('Y-m-d\TH:i:s.u'); } $microtime = microtime(true); print_r(sprintf('%.f', $microtime)); $test = GetFormattedMicroTime(); print_r($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nniAu
function name:  (null)
number of ops:  18
compiled vars:  !0 = $microtime, !1 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    8     4        INIT_FCALL                                               'print_r'
          5        INIT_FCALL                                               'sprintf'
          6        SEND_VAL                                                 '%25.f'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
    9    11        INIT_FCALL                                               'getformattedmicrotime'
         12        DO_FCALL                                      0  $6      
         13        ASSIGN                                                   !1, $6
   10    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function getformattedmicrotime:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/nniAu
function name:  GetFormattedMicroTime
number of ops:  20
compiled vars:  !0 = $timestamp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      <false>
    3     1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->7
    4     3    >   INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    5     7    >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          8        SEND_VAL                                                 'U.u'
          9        INIT_FCALL                                               'sprintf'
         10        SEND_VAL                                                 '%25.f'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_FCALL                                      0  $5      
         15        INIT_METHOD_CALL                                         $5, 'format'
         16        SEND_VAL_EX                                              'Y-m-d%5CTH%3Ai%3As.u'
         17        DO_FCALL                                      0  $6      
         18      > RETURN                                                   $6
    6    19*     > RETURN                                                   null

End of function getformattedmicrotime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.16 ms | 1402 KiB | 20 Q