Unit/System Tests PHP 8.x bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar heelc29
heelc29
1 Oct 2025

Summary of Changes

remove no longer needed imagedestroy()

In the migration of various extensions from resources to objects, a number of functions to close or free the resources became no-ops
imagedestroy() since the ext/gd migration in PHP 8.0

https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_imagedestroy

Image::destroy() can be deprecated in future Joomla version (eg. 6.1)

Testing Instructions

Create scheduled task Image Size Check with manual execution and limit of eg. 50px

  • enable max error reporting
  • use php 8.5 (latest pre-version 8.5.0rc1)

Run task

Actual result BEFORE applying this Pull Request

Task status: Terminated
deprecation message (possibly further)
image

Expected result AFTER applying this Pull Request

Task status: Completed
no deprecation message about imagedestroy()

Link to documentations

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar heelc29 heelc29 - open - 1 Oct 2025
avatar heelc29 heelc29 - change - 1 Oct 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Oct 2025
Category Libraries Unit Tests
avatar heelc29 heelc29 - change - 1 Oct 2025
Labels Added: Unit/System Tests PR-5.4-dev
avatar heelc29 heelc29 - change - 16 Oct 2025
Labels Added: PHP 8.x bug
avatar muhme
muhme - comment - 17 Oct 2025

✅ Tested with JBT php8.5-rc

  • Before the PR with 'Image Size Check' Scheduled Task seen PHP warning Function imagedestroy() is deprecated and task failed with JSON.parse: unexpected character at line 1 column 1 of the JSON data
  • Applied patch with patchtester
    • ✅ no more Function imagedestroy() is deprecated
    • ✅ Scheduled Task 'Image Size Check' runs successful and one more image is reduced in size
  • Switched to PHP 8.1
    • ✅ Scheduled Task 'Image Size Check' runs successful and one more image is reduced in size
avatar muhme muhme - change - 17 Oct 2025
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-10-17 11:14:24
Closed_By muhme
avatar muhme muhme - close - 17 Oct 2025
avatar muhme muhme - merge - 17 Oct 2025
avatar muhme
muhme - comment - 17 Oct 2025

Thank you @heelc29 for your contribution. Thank you @QuyTon and @HLeithner for your code reviews.

Add a Comment

Login with GitHub to post a comment