Bug #79975 [NEW]: DateTime::createFromFormat returns static type

From: Date: Thu, 13 Aug 2020 22:26:37 +0000
Subject: Bug #79975 [NEW]: DateTime::createFromFormat returns static type
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228585@lists.php.net to get a copy of this message
From:             corey dot taylor dot fl at gmail dot com
Operating system: 
PHP version:      8.0.0beta1
Package:          *General Issues
Bug Type:         Bug
Bug description:DateTime::createFromFormat returns static type

Description:
------------
I don't know if this is actually a bug or intended behavior or undefined
behavior. However, since it's been consistent up to 8.0.0beta1, I
thought I'd report the change.

https://3v4l.org/dgunY


DateTime::createFromFormat() used to always return a DateTime instance
if called from a class that extended DateTime and wrapped
createFromFormat().

Now, it is returning the static type. In this example,that is an
ExtendsDateTime instance.

https://bugs.php.net/bug.php?id=60302

Looking, I see a very old bug that suggests this was supposed to be the
fixed behavior, but clearly wasn't. We have some low level framework
behavior keyed off the type of instance constructed, so we'd like to
make sure this is the intended switch for PHP 8.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=79975&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=79975&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=79975&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=79975&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=79975&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=79975&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=79975&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=79975&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=79975&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=79975&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=79975&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79975&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=79975&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=79975&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=79975&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=79975&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=79975&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=79975&r=mysqlcfg


Thread (11 messages)

« previous php.bugs (#228585) next »