Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Fun fact, what @irene is suggesting is a standard technique sometimes called Yoda notation or Yoda conditionals (because it's like Yoda's often-inverted grammar). Useful.
-
Same is with js and python when you want to send a function as argument and put the () behind them. It will just execute instead of pass through. Gave me plenty of headaches.
-
xewl41716ySame with this..
if(
$someCheckVar
&& $weNeedThis = 'yo'
) // weneedthis: "yo"
if(
$weNeedThis = 'yo'
&& $someCheckVar
) // weneedthis: true -
$var = 5..
If you want it to be 7, you have to use = 7, not = 5.
Php doesn’t tell you that..
You’re welcome 😂
Hey... to somebody reading this, most likely.
The problem, is that you put if($var = 'something')
You need ==, not =.
Php doesn't tell you that though. It'll just change the var to 'something'
That's why you're getting that really obscure, doesn't make any sense error.
You're welcome.
rant
php wtf catch that