Fatal error on PHP 5.3.29
-
I updated to 8.0.3 and got a fatal error related to the [ square bracket ] to initialise the $replacements array in convert_phpformat_to_js() function in includes/admin/helpers/class-rop-cron-helper.php
My site is on PHP 5.3.29 (I know! It’s ancient! An old OpenCart is also on the server so I am reluctant to update).The fix is to change [] to array().
— includes/admin/helpers/class-rop-cron-helper.orig.php 2018-04-26 12:27:32.000000000 +0100
+++ includes/admin/helpers/class-rop-cron-helper.php 2018-05-01 10:26:11.178206800 +0100
@@ -183,7 +183,7 @@
* @return string
*/
private function convert_phpformat_to_js( $format ) {
– $replacements = [
+ $replacements = array(
‘d’ => ‘DD’,
‘D’ => ‘ddd’,
‘j’ => ‘D’,
@@ -221,7 +221,7 @@
‘c’ => ”, // no equivalent
‘r’ => ”, // no equivalent
‘U’ => ‘X’,
– ];
+ );
$momentFormat = strtr( $format, $replacements );return $momentFormat;
Unfortunately even fixing this caused a fatal error but I could not access my server logs to investigate further (I am running with WP_DEBUG set to true but wp-content/debug.log is not getting written to).
- The topic ‘Fatal error on PHP 5.3.29’ is closed to new replies.