Closed zainengineer closed 7 years ago
@zainengineer on which php version are you running? This sounds like PHP7?
@arendjantetteroo I am running 5.4.16
It is because empty
is used for both isset
and condition check.
And newer PHP versions don't allow isset
or empty
check against a function.
@carcus88 can you check if these changes work for you? I'm not using this code at the moment and don't want to break things for others, and as you just added a PR a few days ago I thought i'd ask you for confirmation.
I think the code is fine the way it is as long as the package is marked as PHP 5.5+ required. The problem is that PHP <= 5.4 do not allow function calls inside of empty. (Opposite of what you are asserting @zainengineer )
"5.5.0 empty() now supports expressions, rather than only variables."
Thanks @carcus88. As i've not seen this error myself, i found it weird, but things change between PHP versions so it makes sense. I'll tag it as php 5.5+ required in composer.json next time.
@zainengineer if you can upgrade your PHP version i would advise that, Php 5.4 is EOL for almost a year now, so i won't be merging this. You can off course use your own branch until you can upgrade.
@zainengineer I actually found myself in the same situation when I deployed today and realized that I was testing on php5.6 but production is still behind on php5.4.
I created a release in my fork that supports php5.4 if you want to use that
https://github.com/carcus88/guzzle-toggl/releases/tag/v0.12
To use it just drop this in your composer.json
"repositories": [
{
"type": "vcs",
"url": "https://github.com/carcus88/guzzle-toggl"
}
],
"require" : {
"ajt/guzzle-toggl": "^0.12.0"
}
Closing, feel free to use carcus88 solution.
because of empty check against function PHP throws FATAL as soon as it includes the file error message is Can’t use method return value in write context