note 125390 added to migration74.incompatible
| From: | gyorgy dot bakocs at ipricegroup dot com | Date: | Thu, 24 Sep 2020 01:27:17 +0000 |
| Subject: | note 125390 added to migration74.incompatible | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215463@lists.php.net to get a copy of this message | ||
Hello.
I faced a strange issue after upgrade our system to 7.4.
In our codebase we use strptime to get the release mont to our products.
In this way: $month = strptime($month, '%B')['tm_mon'] + 1;
So we use '%B' -> full month name
In PHP 7.2 everything works fine, but in 7.4 it returns with FALSE.
I put a simple test into our system with some hardcoded data:
(it is in the route.php so the test is pure php, laravel does not affect it)
Route::get('test', function () {
dump(strptime('Tháng 9', '%B'));
dump(strptime('Tháng ChÃn', '%B'));
});
The result in 7.2:
false
array:9 [â¼
"tm_sec" => 0
"tm_min" => 0
"tm_hour" => 0
"tm_mday" => 0
"tm_mon" => 8
"tm_year" => 0
"tm_wday" => 5
"tm_yday" => 242
"unparsed" => ""
]
So it seems OK, because 'Tháng 9' is the sort name.
BUT in 7.4
array:9 [â¼
"tm_sec" => 0
"tm_min" => 0
"tm_hour" => 0
"tm_mday" => 0
"tm_mon" => 8
"tm_year" => 0
"tm_wday" => 5
"tm_yday" => 242
"unparsed" => ""
]
false
The sort name returns with data even though I use '%B'
and the long name return with false!
I could not find any documentation about this change.
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.172 (proxied: 121.121.224.97)
----
Manual Page -- http://php.net/manual/en/migration74.incompatible.php
Edit -- https://master.php.net/note/edit/125390
Del: integrated -- https://master.php.net/note/delete/125390/integrated
Del: useless -- https://master.php.net/note/delete/125390/useless
Del: bad code -- https://master.php.net/note/delete/125390/bad+code
Del: spam -- https://master.php.net/note/delete/125390/spam
Del: non-english -- https://master.php.net/note/delete/125390/non-english
Del: in docs -- https://master.php.net/note/delete/125390/in+docs
Del: other reasons-- https://master.php.net/note/delete/125390
Reject -- https://master.php.net/note/reject/125390
Search -- https://master.php.net/manage/user-notes.php