3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(DateTimeImmutable::createFromMutable(new DateTime('midnight'))); var_dump(DateTimeImmutable::createFromMutable(new DateTimeImmutable('midnight')));
based on sHrQ2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3IrR6
function name:  (null)
number of ops:  19
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   INIT_FCALL                                               'var_dump'
         1        INIT_STATIC_METHOD_CALL                                  'DateTimeImmutable', 'createFromMutable'
         2        NEW                                              $0      :0
         3        SEND_VAL_EX                                              'midnight'
         4        DO_FCALL                                      0          
         5        SEND_VAR                                                 $0
         6        DO_FCALL                                      0  $2      
         7        SEND_VAR                                                 $2
         8        DO_ICALL                                                 
   4     9        INIT_FCALL                                               'var_dump'
        10        INIT_STATIC_METHOD_CALL                                  'DateTimeImmutable', 'createFromMutable'
        11        NEW                                              $4      :8
        12        SEND_VAL_EX                                              'midnight'
        13        DO_FCALL                                      0          
        14        SEND_VAR                                                 $4
        15        DO_FCALL                                      0  $6      
        16        SEND_VAR                                                 $6
        17        DO_ICALL                                                 
        18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0