Cannot redeclare __construct bug
-
Hello,
I tested this little code on standard PHP7.4 without any error e.g. on http://www.writephponline.com
function test_class() { return new class { public $value; function __construct() { $this->value = 'my value'; } public function some_class() { return new class { public $internal; function __construct() { $this->internal = "internal"; } }; } }; } echo test_class()->some_class()->internal;When going on with code snippets, I have a __construct redeclare bug… tested on WordPress 5.5.1 fresh site.
So I believe there is something wrong with the plugin somewhere.
Any help is appreciated.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Cannot redeclare __construct bug’ is closed to new replies.