• After updating to php 7.4 as recommended by WordPress i am getting the following error in my logs
    PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in xxx//plugins/image-regenerate-select-crop/image-regenerate-select-crop.php on line 950

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hi,

    Thanks for letting me know. I will assess and push a fix.

    Regards,
    Iulia

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Please upgrade and let me know if this is still an issue for you.

    I’m getting that error with the latest plugin version. Lines 951 & 952.
    WP 5.4.2
    php 7.4.2

    • This reply was modified 3 years, 9 months ago by dm10014.
    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hi,

    Just to be sure we are looking at the same piece of code:

    
    947		if ( version_compare( phpversion(), '7.4', '>=' ) ) {
    948			$c_v = $sc[0];
    949			$c_h = $sc[1];
    950		} else {
    951			$c_v = $sc{0};
    952			$c_h = $sc{1};
    953		}
    

    If lines 951 & 952 are executed in your instance, it means you are not running PHP >= 7.4

    I have testest up to 7.4.7 and I cannot replicate the issue. Please check what phpversion() and version_compare( phpversion(), '7.4', '>=' ) return in your site, maybe these are not consistent. Are you using Apache or Nginx?

    Regards,
    Iulia

    • This reply was modified 3 years, 9 months ago by Iulia Cazan.

    Yes, that’s the code. Definitely running php 7.4.2 via MAMP on localhost, with Apache 2.2.34. phpversion() returns 7.4.2; version_compare( phpversion(), '7.4', '>=' ) returns true, so not sure why it’s even reading lines 951 & 952

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Yes, super weird :). Try to change the condition like if ( true === version_compare( phpversion(), '7.4', '>=' ) ) { to see if that changes something, maybe it’s a PHP 7.4.2 issue.

    Still throws the warning. Can’t upgrage to php 7.4.7 (on free MAMP, not PRO) so for now will just comment out the else {}. It’s a mystery!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘php 7,4 Deprecated: error’ is closed to new replies.