- Edited
TIL that PHP 8.2 has deprecated the dynamic creation of object variables. E.g., this will throw a warning:
class Foo {
public $foo;
public function __construct() {
$this->foo = 'Foo';
$this->bar = 'Bar'; // $bar was not declared
}
}
$test = new Foo();
Deprecated: Creation of dynamic property Foo::$bar is deprecated in...
(I was looking into upgrading an old app from 8.1 to 8.2, and ran into this in a bunch of places.)