Yii Framework Forum: closing php blocks - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

closing php blocks Rate Topic: -----

#1 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 10 October 2008 - 12:05 PM

I recognized that in all your php classes you never close the <?pbp  ?> block. Is this intentionally? I believe that for the parser it might be the same if he receives the EOF or the block end but is this behaviour of the parser also guaranteed for future php versions?

Hmmm, perhaps only a java programmer can ask such a question  8)

D.

0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,900
  • Joined: 04-October 08
  • Location:DC, USA

Posted 10 October 2008 - 12:07 PM

Yes, it is intentionally. This is actually a recommended practice, because it often happens that some additional blanks or lines are appended after ?>, which will be displayed and cause some issues if session is started.
0

#3 User is offline   dyrathror 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 07-October 08

Posted 10 October 2008 - 12:20 PM

Thanks, always good to learn something new :)

I didn't think about trailing blanks which might corrupt the layout.
Good that you pointed me to that, otherwise I might have spent hours to search for such an error.


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users