Comments (1)
2012
is being interpreted as a time and not a year (obviously). It's a much more common use case for an arbitrary string to describe, and PHP can only support one possible interpretation of a given string.
https://www.php.net/manual/en/datetime.formats.php
If you know that the value is a year, or in general if you know the exact format of the input string, then use createFromFormat
instead.
from php-src.
Related Issues (20)
- Deprecated: voku\helper\ASCII::to_ascii() HOT 1
- Hooks on constructor promoted properties without visibility are ignored HOT 3
- Add support for CURLOPT_TCP_KEEPCNT (available since curl 8.9.0) HOT 1
- Modules (Import & Export Variables and Functions) HOT 2
- Segmentation fault (null pointer) in Zend/zend_builtin_functions.c HOT 1
- Drop support for MYSQL_TEST_SKIP_CONNECT_FAILURE HOT 8
- foreach with updated $record does not update $record HOT 6
- Member access within misaligned address in ext/opcache/jit/zend_jit_vm_helpers.c HOT 1
- Use C23 memset_explicit() for ZEND_SECURE_ZERO() if available HOT 2
- ssh2.sftp:// stream handling broken > 8.3.9 HOT 4
- Member access within misaligned address in ext/opcache/jit/zend_jit.c HOT 1
- Signed integer overflow in ext/date/lib/unixtime2tm.c and ext/date/lib/parse_posix.c:493 HOT 2
- Add get_public_members Function to PHP HOT 5
- Segmentation fault (access null pointer) in Zend/zend_stack.c HOT 2
- Opcache with file_cache and JIT enabled crashes an application HOT 1
- Allow php-fpm to protect users/website operators on a multi-user system against each other
- file_put_contents on string >= 2GB HOT 2
- Windows build system defines HAVE_<header>_H as 0 or 1 HOT 2
- Reproducible crash in PHP 8.4 with JIT and Excimer HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-src.