1--TEST-- 2Tests for DateTime::createFromImmutable. 3--INI-- 4date.timezone=Europe/London 5--FILE-- 6<?php 7$current = "2014-03-02 16:24:08"; 8$i = date_create_immutable( $current ); 9 10$m = DateTime::createFromImmutable( $i ); 11var_dump( $m ); 12 13$m->modify('+ 1 hour'); 14 15var_dump( $i->format('Y-m-d H:i:s') === $current ); 16 17$m = DateTime::createFromImmutable( date_create( $current ) ); 18var_dump( $m ); 19?> 20--EXPECTF-- 21object(DateTime)#%d (3) { 22 ["date"]=> 23 string(26) "2014-03-02 16:24:08.000000" 24 ["timezone_type"]=> 25 int(3) 26 ["timezone"]=> 27 string(13) "Europe/London" 28} 29bool(true) 30 31Warning: DateTime::createFromImmutable() expects parameter 1 to be DateTimeImmutable, object given in %stests%eDateTime_createFromImmutable.php on line %d 32NULL 33