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
Output for 5.6.28, 7.0.20 - 7.2.0
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2015-09-24 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 7.0.6
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-05-03 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 7.0.5
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-03 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 7.0.4
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-10 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 7.0.3
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-18 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 7.0.2
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-22 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 7.0.1
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-23 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 7.0.0
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-27 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.21
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-05-02 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.20
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-10 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.19
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-07 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.18
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-15 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.17
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-19 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.16
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-28 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.15
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-03-29 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.14
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-02 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.13
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-15 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.12
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-20 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.11
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-23 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.10
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-25 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.9
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-27 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.6.8
object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-04-29 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in /in/3IrR6 on line 4 NULL
Output for 5.5.24 - 5.5.35
Fatal error: Call to undefined method DateTimeImmutable::createFromMutable() in /in/3IrR6 on line 3
Process exited with code 255.
Output for 5.3.18 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/3IrR6 on line 3
Process exited with code 255.