3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (class_exists('DateTimeImmutable')) { $date = new DateTimeImmutable('2015-01-01 00:00:00.123456'); echo serialize($date), PHP_EOL; echo json_encode($date), PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/FAOQA
function name:  (null)
number of ops:  19
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'class_exists'
          1        SEND_VAL                                                 'DateTimeImmutable'
          2        DO_ICALL                                         $1      
          3      > JMPZ                                                     $1, ->18
    4     4    >   NEW                                              $2      'DateTimeImmutable'
          5        SEND_VAL_EX                                              '2015-01-01+00%3A00%3A00.123456'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
    5     8        INIT_FCALL                                               'serialize'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        ECHO                                                     $5
         12        ECHO                                                     '%0A'
    6    13        INIT_FCALL                                               'json_encode'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $6      
         16        ECHO                                                     $6
         17        ECHO                                                     '%0A'
    7    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.1 ms | 1395 KiB | 19 Q