Notices and Fatal Error in Parsedown.php
I seem to get this error sometimes:
Notice: Array to string conversion in /vendor/yahnis-elsts/plugin-update-checker/vendor/Parsedown.php on line 1412
Notice: Undefined property: Parsedown::$Array in /vendor/yahnis-elsts/plugin-update-checker/vendor/Parsedown.php on line 1412
Fatal error: Uncaught Error: Function name must be a string in /vendor/yahnis-elsts/plugin-update-checker/vendor/Parsedown.php on line 1412
I've read here it might have something to do with PHP 7 but it happened on PHP 5.6 as well. Could you update the Parsedown script to the latest version?
The latest version of Parsedown requires PHP 5.3, so I can't use that. I'd like to stay compatible with the minimum PHP version that's currently supported by WordPress (5.2.4). At the moment, about 9% of WordPress sites are still on PHP 5.2.
Have you found a way to reliably reproduce this error? Maybe there's a way to fix it without upgrading all the way to Parsedown 1.6.0.
I'll look into it for you :)
Hmm, the issue really is related to PHP7. For Parsedown to work, some lines need to be rewritten in Parsedown like this:
$markup .= $this->{$Element['handler']}($Element['text']);
Instead of
$markup .= $this->$Element['handler']($Element['text']);
Since that only works since PHP 5.3, would it be possible to include both the 1.5.0 version and the 1.6.0 version and load the correct one according to the installed PHP version? This way you can still support PHP 5.2, but also support newer PHP versions.
Good to see it's merged, thnx :)