Hey,
after I’ve upgraded my PHP to version 7 I found the following error being displayed for one plugin I was using:
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected ‘new’ (T_NEW) in /var/www/vhosts/wp-content/plugins/smilies-themer/smilies-themer.php on line 80
The solution was pretty easy. Just open an editor on the file and line PHP tells you. Now you should see something like
$this->smilies =& new smilies_package($this->current_smilies);
Here they made some changes in PHP 7. You can’t assign classes with a & symbol anymore. So just remove that & symbol and the plugin will work fine again (search for multiple occurences).
Here you go, have fun with very fast working new PHP 7 and your (old) WordPress !
:O
thanks. works for me (so far)
Thanks that was a great help about removing the & from &new when using php 7.0.
Regards: Graeme
Thanks, i’m examining some old plugins and this really helped me!
Thanks man
Thanks dude, to thepoint and correct!
Awesome, thanks for the easy fix.
Great!! Thank you. I have fixed a WEBSVN issue using diff
Thanks, it was helpfull.
Sweet, exactly what I needed
Thanks! Checked many sites and yours was the only solution that actually worked!!
Thank you!
Thank you, it’s work
Removing the ‘&’ in the php file worked.
Thank you!
Thanks for the & thing. Worked for me. (so far )
thanks a ton. works like a charm.
Thanks man. Works like a charm
Thank you! This sorted a lot of problems for me. Excellent.
THANK YOU FOR POSTING! This could have wasted hours. Much appreciated!
Oh my goodness! Incredible article dude! Thank you, However I am having problems with your RSS.
I don’t know the reason why I am unable to subscribe to it.
Is there anyone else having the same RSS issues? Anybody who knows the solution will you kindly respond?
Thanx!!
Thanks a lot! You just saved my life (and my wife’s Website).
Thanks. For those wanting to search for files where this might be a problem, here is a decent grep: grep -rn -i –include \*.php ‘= &new’ .
Thank you so much for this easy solution..
Brilliant, helped me solve and fix a site search issue I was having. Thanks for this!
Worked for me too – Thanks!
Thanks! That fixed it.
Thanks!!!! Big Help
Thanks – perfect solution
THANKS!!!
Thank you! Thank you! Thank you!
First off I want to say awesome blog! I had a quick question in which I’d like
to ask if you do not mind. I was interested to know how you center yourself and clear your
head prior to writing. I have had difficulty
clearing my thoughts in getting my ideas out there. I do enjoy writing
but it just seems like the first 10 to 15 minutes are
generally wasted just trying to figure out how to begin. Any ideas or hints?
Kudos!