Notice in debug mode on PHP 7.4
-
Hi Robert,
It’s a bit annoying that this notice keeps popping up in debug mode:
Notice: Only variables should be passed by reference in /wp-content/plugins/website-openclosed-toggle/website-openclosed-toggle.php on line 38
The line in question is:
define( ‘RS_WOCT__PLUGIN_DIR_NAME’, end( explode( ‘/’, dirname( __FILE__ ) ) ) );The problem is that the function end expects a (referenced) variable as it will change the internal pointer of this array. My suggestion is to split it up in two lines:
$file = explode( ‘/’, dirname( __FILE__ ) );
define( ‘RS_WOCT__PLUGIN_DIR_NAME’, end( $file ) );Thanks,
Andre
- The topic ‘Notice in debug mode on PHP 7.4’ is closed to new replies.