-
Bug
-
Resolution: Fixed
-
Minor
-
3.10.1
-
MOODLE_310_STABLE
-
MOODLE_311_STABLE
-
MDL-70966-master -
From https://php.watch/versions/8.0#string-number-comparison and release notes:
https://php.watch/versions/8.0/string-number-comparison
Non-strict comparisons between numbers and non-numeric strings now work by
casting the number to string and comparing the strings. Comparisons between
numbers and numeric strings continue to work as before. Notably, this means
that `0 == "not-a-number"` is considered false now.
RFC: https://wiki.php.net/rfc/string_to_number_comparison
(so they changed what's converted, previously the string was coerced to number, now the opposite)
For example, the following snippet returns true on PHP7 and false on PHP8:
var_dump('' == 0);
|
This causes some errors around Moodle where we expected empty string to be treated as 0.
See sandbox: http://sandbox.onlinephpfunctions.com/code/0a8af6908807e6da5172584e6c9d0842609bf6e1
- has been marked as being related by
-
MDL-71394 PHP8: All new blog entries appear to be in the draft state by default
-
- Closed
-
-
MDL-71395 PHP8: Google_Service_YouTube does not return error message in PHP8
-
- Closed
-
- will help resolve
-
MDL-70926 PHP 8.0: getdate(null) returns current date instead of Jan 1st 1970 as it is in php7
-
- Closed
-