Bug #79975 [NEW]: DateTime::createFromFormat returns static type
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)
- corey dot taylor dot fl at gmail dot com
- derick@php.netBug #79975 [Opn]: DateTime::createFromFormat returns static type
- corey dot taylor dot fl at gmail dot comBug #79975 [Com]: DateTime::createFromFormat returns static type
- corey dot taylor dot fl at gmail dot comBug #79975 [Com]: DateTime::createFromFormat returns static type
- mark at mark-story dot comBug #79975 [Com]: DateTime::createFromFormat returns static type
- corey dot taylor dot fl at gmail dot comBug #79975 [Com]: DateTime::createFromFormat returns static type
- derick@php.netBug #79975 [Opn]: DateTime::createFromFormat returns static type
- corey dot taylor dot fl at gmail dot comBug #79975 [Com]: DateTime::createFromFormat returns static type
- nikic@php.netBug #79975 [Opn]: DateTime::createFromFormat returns static type
- corey dot taylor dot fl at gmail dot comBug #79975 [Com]: DateTime::createFromFormat returns static type
- derick@php.netBug #79975 [Opn->Wfx]: DateTime::createFromFormat returns static type