Update codebase for php 7.3 and php 7.4
Bug #1839411 reported by
Rebecca Blundell
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Wishlist
|
Rebecca Blundell |
Bug Description
I tried running behat tests in php 7.3 and among other issues got the following error due to a PHP 7.3 deprecation:
/code/mahara/
8192: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in ~/code/
This made me think we should check the code for this and other 7.3 issues. Notes on migrating to 7.3:
https:/
And on migrating to 7.4:
https:/
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → Wishlist |
summary: |
- Update codebase for php 7.3 + Update codebase for php 7.3 and php 7.4 |
Changed in mahara: | |
assignee: | nobody → Rebecca Blundell (rjb-dev) |
description: | updated |
Changed in mahara: | |
milestone: | none → 20.04rc2 |
Changed in mahara: | |
status: | Confirmed → Fix Committed |
Changed in mahara: | |
milestone: | 20.04rc2 → 20.04.0 |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Notes after reading documentation on what might affect Mahara. I have included a note about anything here that has changed that we use in the code, regardless of whether a change is needed. Many of these are in the category of 'check this to make sure' rather than 'we have to make changes'. Some things are hard to check for issues with, so it may be necessary to upgrade and see what breaks.
PHP 7.3
continue in switch statements behaves as break. This is not new, but the correct usage is break or continue2 depending on what you want.
some differences with how doc strings work, implicit conversion of array object "123" to 123 won't happen; static props can't be separated from the parent class; Assigning by reference happens on access;
getimagesize() now report the mime type of BMP images as image/bmp instead of image/x-ms-bmp (do we rely on this behaviour anywhere?)
simplexml uses float as well as int now, implicitally. (Any probs with this?)
libcurl ≥ 7.15.5 is now required.
https:/ /www.php. net/manual/ en/migration73. incompatible. php
7.4
Strong typing is supported.
checkout str_split - possibly better to use mb_str_split in 7.4??(but not backwards, so no.)
PDO stuff important to know.
strip_tags() easier
check fread() for tests of ''. Now a non-read will be false (7.4)
in cli.php/ file.php ...
Check for comparisons on DateTime objects
Check usage of get_object_ vars(array) for use to get values.
Check for non-bracketed nested ternary operators
adodb has calls to deprecated functions get_magic_ quotes_ gpc() and get_magic_ quotes_ runtime( ). Look for update
Also calls fgetcsv which has changed function.
Passing parameters to implode() in reverse order is deprecated, use implode($glue, $parts) instead of implode($parts, $glue). Fix this.
Check behaviour of parse_data in csvfile.php (change to funct fgetcsv())
Check behaviour of imagescale() in skin.php (Change to funct)
check libxml version (needs to be at least 2.7.6)
Do we need PEAR for stuff (I think so.) Check what happens on install. We may need to enable it. (It's no longer enabled by default).
Changes to constants in ReflectionClass may affect $refClass in errors.php
Changes to constants in ReflectionFunction may affect $refFunc in errors.php
Elasticsearch and Dwoo also rely on ReflectionFunction - check for update.
Changes to constants in ReflectionMethod may affect Dwoo, Elasticsearch and htmlpurifier - check for update
SImpleXMLElement implements Countable now - check if that means any new errors/usage changes
Does removal of libzip have any flow-on effects (e.g. need to include another syslib in instructions?)