Difference between #8 and #9 of
The Comedy of Errors

Revision #9 has been created by softark on Mar 23, 2013, 2:23:23 AM with the memo:

Added "Semicolon"
« previous (#8) next (#10) »

Changes

Title unchanged

The Comedy of Errors

Category unchanged

Others

Yii version unchanged

Tags unchanged

errors comedy

Content changed

[...]
Sure we have 'exists' method for CActiveRecord model, but ...

Ending ?> tag in non-view
---------------------------------

Extend a base class or edit a config file (needs to be included before the sessions starts) and leave a ?> at the ending with at least one trailing white space character. Make sure output buffering is off. Cry manly tears while trying to figure out why "Cannot modify header information - headers already sent" spams your log files.

 
 
Semicolon
 
---------
 
 
 
```php 
$total = 0;
 
foreach($model->rels as $rel);
 
{
 
    $total += $rel->count;
 
}
 
echo $total; // wrong result!!
 
```
 
 
I wasted 12 hours debugging this.
19 0
16 followers
Viewed: 10 878 times
Version: 1.1
Category: Others
Written by: fsb
Last updated by: Mike
Created on: Dec 7, 2011
Last updated: 4 years ago
Update Article

Revisions

View all history