Page MenuHomeDevCentral

Port Obsidian code to PHP 8.4
Open, NormalPublic

Event Timeline

dereckson triaged this task as Normal priority.Fri, Oct 17, 16:45
dereckson created this task.
dereckson added a project: PHP 8.x support.

This is the priority, before even the CI pipeline.

Just an example: PHP Fatal error: Cannot redeclare function get_resource_id()

We've a global function with the same name than a new function introduced in PHP 8.

With 8.4.13, php -l gives:

1> find */src -type f -name '*.php' | xargs -I {} php -l {} 1> /dev/null
2PHP Deprecated: DatabaseException::__construct(): Implicitly marking parameter $previous as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/database/DatabaseException.php on line 38
3PHP Deprecated: Database::load(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/database/Database.php on line 35
4PHP Deprecated: MySQLCollection::__construct(): Implicitly marking parameter $client as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/collection/MySQLCollection.php on line 61
5PHP Deprecated: MongoDBCollectionIterator::__construct(): Implicitly marking parameter $cursor as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/collection/MongoDBCollectionIterator.php on line 38
6PHP Deprecated: Smarty_Internal_Resource_File::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_resource_file.php on line 27
7PHP Deprecated: Smarty_CacheResource::process(): Implicitly marking parameter $cached as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_cacheresource.php on line 56
8PHP Deprecated: Smarty_Internal_Resource_Registered::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_resource_registered.php on line 29
9PHP Deprecated: Smarty_Internal_CacheResource_File::process(): Implicitly marking parameter $cached as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_cacheresource_file.php on line 87
10PHP Deprecated: Smarty_Internal_Resource_PHP::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_resource_php.php on line 37
11PHP Deprecated: Smarty_Internal_Resource_Stream::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_resource_stream.php on line 31
12PHP Deprecated: Smarty_Internal_Resource_Eval::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_resource_eval.php on line 30
13PHP Deprecated: Smarty_Resource_Custom::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_resource_custom.php on line 49
14PHP Deprecated: Smarty_Internal_Resource_String::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_resource_string.php on line 30
15PHP Deprecated: Smarty_CacheResource_Custom::process(): Implicitly marking parameter $cached as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_cacheresource_custom.php on line 116
16PHP Deprecated: Smarty_Internal_Resource_Extends::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_internal_resource_extends.php on line 34
17PHP Deprecated: Smarty_CacheResource_KeyValueStore::process(): Implicitly marking parameter $cached as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_cacheresource_keyvaluestore.php on line 87
18PHP Deprecated: Smarty_Resource::populate(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_resource.php on line 83
19PHP Deprecated: Smarty_Resource::buildFilepath(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_resource.php on line 206
20PHP Deprecated: Smarty_Resource::source(): Implicitly marking parameter $_template as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_resource.php on line 521
21PHP Deprecated: Smarty_Resource::source(): Implicitly marking parameter $smarty as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/smarty/sysplugins/smarty_resource.php on line 521
22PHP Deprecated: Language::Load(): Implicitly marking parameter $context as nullable is deprecated, the explicit nullable type must be used instead in workspaces/src/includes/i18n/Language.php on line 63

Next, try to run Rector to fix issues like:

Fatal error: Declaration of MySQLDatabase::load(Context $context) must be compatible with Database::load(?Context $context = null) in /var/51-wwwroot/obsidian/workspaces/src/includes/database/MySQLDatabase.php on line 50