Topic: Error thrown php 8.4.10 compatibility?

When adding a new image to an item, I got this error:

Creation of dynamic property TCPDF::$padding is deprecated in file: /home/pelham10/public_html/fa/reporting/includes/tcpdf.php at line 1172
/home/pelham10/public_html/fa/reporting/includes/tcpdf.php:185:    (TCPDF Object)->__construct()
/home/pelham10/public_html/fa/inventory/manage/items.php:173: check_image_file('../../company/0/images/Coin_2025_Town_Hall.jpg')

Re: Error thrown php 8.4.10 compatibility?

https://wiki.php.net/rfc/deprecate_dynamic_properties
Declare property before usage in PHP 8.2 and above.

// PHP <= 8.1: Silently creates dynamic undeclared property
// PHP    8.2: Raises deprecation warning, still creates dynamic property if undeclared.
// PHP    9.0: Throws Error exception.

Hence if you are using PHP >= 8.2 then at Line 211 of reporting/includes/tcpdf.php insert the following:

        /**
        * @var cell binary padding
        * @access protected
        */
        var $padding;

@joe: is this necessary to be in the core for all such instances of undeclared properties?

Re: Error thrown php 8.4.10 compatibility?

I will have a look into these problems with missing declarations of members in some classes.
We will have to declare them inside the classes.

Joe