softark
(Softark)
1
I wasted 12 hours debugging this …
$total = 0;
foreach($model->rels as $rel);
{
$total += $rel->count;
}
echo $total; // wrong result!!
Who in the hell wrote that wicked semicolon? Me?
In the real source, the relation was a little bit complicated, and I wasted time examining it.
reza.m
(Reza Mms)
2
It happens sometimes, especially when it’s time to sleep 
softark
(Softark)
3
Exactly. 
Going to bed was the right solution to me.
yugenekr
(Yugenekr)
4
Yeaah, such typos are the most difficult ones to fix.
Thanks for showing it, might probably save 12 hrs to someone else 
That’s why Gods created 1TBS.
softark
(Softark)
6
Yeah, I have to confess that I regretted a bit of my coding style preference.
BTW, is there any clever IDE to warn this kind of possible mistake?
samdark
(Alexander Makarov)
7
Code is valid so I doubt any IDE will complain. Yii2 code style will be better in this regard.
softark
(Softark)
8
So, I finally changed my IDE from NetBeans to PhpStorm.
4060

It underscores $rel and says “Variable ‘rel’ might have not been defined.”
PhpStorm reads the code … You feel like you are doing the "pair programming" with someone who is clever enough.
yiibjorn
(Bjorn)
9
Haha so recognizable, I allmost killed my computer for a semicolon like that
.
Thanks for the tip about PHPStorm, gonne take a look into that. I’m using Aptana and it won’t give me heads up about this either.