Open funderburkjim opened 1 year ago
PHP classes are somewhat like Python classes, though with different syntax. There is a constructor function which constructs instances of the class, and this is where instance attribute (properties) are specified.
However, prior to 8.2, it was also possible to define the value of an instance variable which was not declared in the constructor. The error message above noticed that $status was used as a property (instance variable) of the Dal class but was NOT declared as an instance variable in the constructor.
Luckily, this problem is easily fixed by declaring, in the constructor function of the Dal class, that
$status is an instance variable (public $status;
).
This kind of change was made in several php modules, as detailed in comments below.
The above commit message shows the details. The modules changed were:
Several similar changes required so simple-search works with php 8.2
A user (Peter Scharf) wanted to update the dictionary displays on a Mac computer. Mac computers have stopped pre-installing PHP. He finally got php installed, using homebrew and changing a few settings (I'm not sure which were changed).
Then he used the (mwweb1.zip at https://sanskrit-lexicon.uni-koeln.de/scans/MWScan/2020/web/webtc/download.html) and put this 'web' directory in the appropriate spot (/Library/Webserver/Documents/cologne/mw/web).
Now the displays partially worked, but exhibited a bunch of new PHP warnings, such as
It turns out that this 'dynamic property' deprecation was introduced in php 8.2; since I had been running php 8.1.1 locally, and also not yet php 8.2 at Cologne, this warning had not occurred previously.
Further comments will describe the (easy) fix, and what files were changed.