1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/date/tests/bug60302-001.phpt
Derick Rethans 90434d7fe3 Fixed bug #60302: DateTime::createFromFormat should new static(), not new self()
Also fixes similar issues for DateTimeImmutable::createFromFormat,
DateTime::createFromImmmutable, DateTime::createFromInterface,
DateTimeImmutable::createFromMutable, and
DateTimeImmutable::createFromInterface.
2020-08-03 00:43:41 +01:00

14 lines
252 B
PHP

--TEST--
Test for bug #60302: DateTime::createFromFormat should new static(), not new self()
--FILE--
<?php
class MyDateTime extends DateTime { }
$d = MyDateTime::createFromFormat('Y-m-d', '2011-01-01');
echo get_class($d);
?>
--EXPECT--
MyDateTime