-2

I'm getting this error and I do not know how to resolve

Fatal error: Can't use function return value in write context in /home/***/public_html/****.com/wp-content/themes/****/functions.php on line 652

Anybody knows what's going on???

Line 652 is:

if ( !empty( gamexls_get_option( 'hidecatbox', '' )) ) {

PS Here's the full function.php file, in case it helps:

See this pastebin http://pastebin.com/pyUKvMX5

-

Athia
  • 17
  • 9
  • The error is pretty clear. You cannot use a function result in a call to `empty()` in php version <5.6. That is clearly documented. I suggest you start reading the documentation of the tools you use: http://php.net/manual/en/function.empty.php – arkascha Jan 17 '16 at 12:57
  • It may be clear to you but not to me, hence why i asked it and you should answer without the condescending tone. – Athia Jan 24 '16 at 04:48
  • Interesting how this is marked duplicate but there is nothing mentioning where it is duplicate from. I have done a search prior to posting and this specific error in this context that I have added in the pastebin is unique. – Athia Jan 24 '16 at 04:49
  • the linked question http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them?lq=1 in no way is a duplicate of the one I put up @ Riztard – Athia Jan 24 '16 at 04:50
  • Sorry, but to me the documentation is _more than clear_ in this point: "empty() only supports variables; anything else will result in a parse error". A function call certainly is not a variable. I do share your point about keeping comments and answers constructive and friendly. However I do not see where my comment is condescending. Sorry if you are sensitive in that area. But when reading through my comment above all I see is the invitation to start reading the documentation which will certainly help. That too is a point most people here share, since it makes sense. – arkascha Jan 24 '16 at 08:18
  • No, it does not answer the question, it refers to a manual where somewhere an answer may be located. – Athia Jan 25 '16 at 14:13
  • If everyone had this attitude stackexchange might as well close down. Please stay away from any of my future questions as I still do not have an answer to what I needed to know because of you. – Athia Jan 25 '16 at 14:16
  • What do you mean by "it does not answer the question"? What do you mean by "an answer _may_ be located"? The answer _is_ there, you can read it, it is understandable. Could it be that you do not _want_ to read it? Could it be that you prefer that you are handed an answer on a golden plate specifically crafted for you? What _exactly_ is it that you do not understand in my comments? Tell me, until now you did not. – arkascha Jan 25 '16 at 18:12
  • it is not an answer in the sense that it does not provide a solution to the question asked. Instead what you did is defer the "solution" to a manual. Do you think that people ask questions on stackexchange to be referred to manuals by people like you? If you were too lazy to write an answer with an actual solution I can understand but you can just say so, no issues. Oh wait you did, but you were not man enough to say so directly. My mistake. – Athia Jan 26 '16 at 18:17
  • Also no need to act so offensive I was merely making a friendly statement. Mind your bloodpressure buddy ;) – Athia Jan 26 '16 at 18:19
  • Your question above was "what's going on". The information I pointed you to answers that in the most precise way possible. You should understand that the reference I gave is not to "some manual". It is THE php documentation. You ask what I think why people ask questions on SO? Sorry, but the answer is _not_: "to receive a perfectly crafted and hand tailored answer that others offer for free in the most humble way possible to honor the almighty person who asked". The answer is: to receive precise information. Which you got. – arkascha Jan 26 '16 at 20:43
  • And about _me_ being offensive... LOL Please read again your own comments above. Thanks. – arkascha Jan 26 '16 at 20:43

1 Answers1

3

Refer to empty manual which says:

Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error

So it should be:

$res =  gamexls_get_option( 'hidecatbox', '' );
if ( !empty($res) ) {
u_mulder
  • 54,101
  • 5
  • 48
  • 64