3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = (string) 1616477400.9510319232940673828125; var_dump( json_encode($value), DateTimeImmutable::createFromFormat( 'U.u', json_encode($value) ), DateTimeImmutable::createFromFormat( 'U.u', number_format($value, 6, '.', '') ), );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Hlth
function name:  (null)
number of ops:  28
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          6  ~1      1.61648e+9
          1        ASSIGN                                                   !0, ~1
    5     2        INIT_FCALL                                               'var_dump'
    6     3        INIT_FCALL                                               'json_encode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
    7     7        INIT_STATIC_METHOD_CALL                                  'DateTimeImmutable', 'createFromFormat'
    8     8        SEND_VAL                                                 'U.u'
    9     9        INIT_FCALL                                               'json_encode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $4      
         12        SEND_VAR                                                 $4
         13        DO_FCALL                                      0  $5      
         14        SEND_VAR                                                 $5
   11    15        INIT_STATIC_METHOD_CALL                                  'DateTimeImmutable', 'createFromFormat'
   12    16        SEND_VAL                                                 'U.u'
   13    17        INIT_FCALL                                               'number_format'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 6
         20        SEND_VAL                                                 '.'
         21        SEND_VAL                                                 ''
         22        DO_ICALL                                         $6      
         23        SEND_VAR                                                 $6
         24        DO_FCALL                                      0  $7      
         25        SEND_VAR                                                 $7
         26        DO_ICALL                                                 
   15    27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.98 ms | 1395 KiB | 19 Q