- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Deprecated Functionality: when runing compile
Hi all
I have two Magento sites both v2.3.3
I have noticed today that I cannot run the compile function:
php -dmemory_limit=4G bin/magento setup:di:compile
I'm getting the following error:
Application code generator... 3/7 [=====>-------] 42% 18 secs 254.0 MiB In ErrorHandler.php line 61: Deprecated Functionality: Array and string offset access syntax with curly braces is deprecated in /home/customer/www/mystagingsite.com/public_html/ vendor/magento/framework/GraphQl/Config/Element/FieldFactory.php on line 49
I have no idea why or what has caused this.
Has anyone else experienced the same and what is the issue/solution please?
PS. I changed the curly brackets in the file from { } to [ ] on line 49 of the mentioned file but then got the following error:
Application code generator... 3/7 [=====>-------] 42% 20 secs 272.0 MiB In ErrorHandler.php line 61: Deprecated Functionality: Unparenthesized `a ? b : c ?: d` is deprecated. U se either `(a ? b : c) ?: d` or `a ? b : (c ?: d)` in /home/customer/www/mystagingsite.com/public_html/vendor/magento/framework-message-queue/BatchC onsumer.php on line 154
This is so odd.
Please help if you can
Andy
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deprecated Functionality: when runing compile
Which php version you are using?
This issue arrives in php 7.4 version.
200+ Magento 2 Extensions for Enhanced Shopping Experience.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deprecated Functionality: when runing compile
Hi Sanjay
Thank you for replying.
My hosting server automatically upgraded php to version 7.4
I have now changed this to 7.3 using their admin dashboard.
Using phpinfo.php it states the php version as 7.3.28
But I still get the compile error.
Any ideas?
Many Thanks
Andy
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deprecated Functionality: when runing compile
Hi Sanjay
Update:
My hosting company has set php 7.4 as the default so to access v 7.3 when running scripts I had to specify the php version - /usr/local/php73/bin/php-cli
Hope this helps others.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deprecated Functionality: when runing compile
Let's say, Something like this in your code:
$str = "test"; echo ($str{0});
So please change the above code with this...
$str = "test"; echo ($str[0]);
Still, you are facing an issue please follow the below link maybe it can help you
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Deprecated Functionality: when runing compile
Hi, i'm facing this issue, did u solve it?