Simple fix for deprecated usage of curly braces
-
Hello there,
On version 2.2.0, the file
polldaddy-shortcode.php
has, on line 451, the following deprecated code:if ( '' === $element || '<' === $element{0} )
The usage of curly braces in the above context has been obsolete for years and years (since 2008) and was finally deprecated in PHP 7.4, with PHP 8.0 throwing a Fatal Error.
The easiest fix is to have instead of the above the following line:
if ( '' === $element || '<' === $element[0] )
References:
https://stackoverflow.com/questions/59158548/array-and-string-offset-access-syntax-with-curly-braces-is-deprecated
https://wiki.php.net/rfc/deprecate_curly_braces_array_access#wasn_t_the_curly_brace_syntax_deprecated_once_before
- The topic ‘Simple fix for deprecated usage of curly braces’ is closed to new replies.