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
17try {
18    DateTime::createFromImmutable( date_create( $current ) );
19} catch (TypeError $e) {
20    echo $e->getMessage(), "\n";
21}
22?>
23--EXPECTF--
24object(DateTime)#%d (3) {
25  ["date"]=>
26  string(26) "2014-03-02 16:24:08.000000"
27  ["timezone_type"]=>
28  int(3)
29  ["timezone"]=>
30  string(13) "Europe/London"
31}
32bool(true)
33DateTime::createFromImmutable(): Argument #1 ($object) must be of type DateTimeImmutable, DateTime given
34