Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-02-02 Thread Larry Garfield

On Mon, 2 Feb 2009 08:23:49 +0100, Yannick Mortier mvmort...@googlemail.com 
wrote:
 2009/2/2 Alpár Török torokal...@gmail.com:


 2009/2/1 Yannick Mortier mvmort...@googlemail.com

 I once read that this is even recommended by the PHP developers... Has
 anyone got a quote for me about this?


 I know thw ZF codinf style includes it as a must. See here :


 http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general

The Drupal coding standards say to exclude the closing ? on files for the same 
reason: It avoids a host of problems with whitespace handling and is just one 
less thing to have to deal with.

http://drupal.org/coding-standards

--Larry Garfield


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-02-01 Thread Yannick Mortier
2009/1/30 Nitsan Bin-Nun nit...@binnun.co.il:
 Do you close your PHP ?php tags?


No, I don't. The reason is that I use subversion and I always get a
message when I don't leave the last line empty.
So I kind of have to leave the ?php Tag opened.
I once read that this is even recommended by the PHP developers... Has
anyone got a quote for me about this?

-- 
Currently developing a browsergame...
http://www.p-game.de
Trade - Expand - Fight

Follow me at twitter! http://twitter.com/moortier

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-02-01 Thread Alpár Török
2009/2/1 Yannick Mortier mvmort...@googlemail.com

 2009/1/30 Nitsan Bin-Nun nit...@binnun.co.il:
  Do you close your PHP ?php tags?
 

 No, I don't. The reason is that I use subversion and I always get a
 message when I don't leave the last line empty.
 So I kind of have to leave the ?php Tag opened.
 I once read that this is even recommended by the PHP developers... Has
 anyone got a quote for me about this?

 --
 Currently developing a browsergame...
 http://www.p-game.de
 Trade - Expand - Fight

 Follow me at twitter! http://twitter.com/moortier

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


I know thw ZF codinf style includes it as a must. See here :

http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general

-- 
Alpar Torok


Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-02-01 Thread Yannick Mortier
2009/2/2 Alpár Török torokal...@gmail.com:


 2009/2/1 Yannick Mortier mvmort...@googlemail.com

 I once read that this is even recommended by the PHP developers... Has
 anyone got a quote for me about this?


 I know thw ZF codinf style includes it as a must. See here :

 http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general

 --
 Alpar Torok


Ah, that must have been it. Thank you.
So, again, I can only recommend you to ommit them because it really
protects you from some stupid bugs that can cost you hours to find.

-- 
Currently developing a browsergame...
http://www.p-game.de
Trade - Expand - Fight

Follow me at twitter!
http://twitter.com/moortier

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-31 Thread tedd

At 8:45 PM +0200 1/30/09, Nitsan Bin-Nun wrote:

I was just wondering whether people enclosing their PHP tags declarations,
I don't close these ?php tags just because the interpreter doesn't really
needs them,
and for the second reason - if a space/tab/new line/etc will beneath them it
will cause
problems with output buffering and session handling.

Do you close your PHP ?php tags?

(at least I closed them here :P look down)
--
?


My mother always told me to close the door. She wasn't a programmer, 
but it kept the chickens out.


As a matter of habit, I always close all tags. However, I have yet to 
be bitten by the problem everyone speaks about (knock on wood).


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-31 Thread Eric Butera
On Sat, Jan 31, 2009 at 10:10 AM, tedd tedd.sperl...@gmail.com wrote:
 My mother always told me to close the door. She wasn't a programmer, but it
 kept the chickens out.

 As a matter of habit, I always close all tags. However, I have yet to be
 bitten by the problem everyone speaks about (knock on wood).

 Cheers,

 tedd

 --
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Right, but the problem isn't us, its them.  I don't have this problem
myself (since I figured out why I was getting those lame headers sent
errors years ago), but when we work in teams... well.. all bets are
off. :(

-- 
http://www.voom.me | EFnet: #voom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-31 Thread Nathan Rixham

Eric Butera wrote:

On Sat, Jan 31, 2009 at 10:10 AM, tedd tedd.sperl...@gmail.com wrote:

My mother always told me to close the door. She wasn't a programmer, but it
kept the chickens out.

As a matter of habit, I always close all tags. However, I have yet to be
bitten by the problem everyone speaks about (knock on wood).

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Right, but the problem isn't us, its them.  I don't have this problem
myself (since I figured out why I was getting those lame headers sent
errors years ago), but when we work in teams... well.. all bets are
off. :(



personally I close and ensure no trailing space; however I have been 
trying to remove the ? recently for files with nothing but php - purely 
to save others grief who may use the code, as I did come across this 
error again recently.


specifically the error in my scenario was called by a DOS format php 
file with trailing lines on a linux box - so I'm guessing that /n is 
trimmed but that leaves the /r which is output on linux systems; hence 
the error.


although, in a world of tags and markup there's something that really 
grates about opening with ?php and not closing it.!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread Eric Butera
On Fri, Jan 30, 2009 at 1:45 PM, Nitsan Bin-Nun nit...@binnun.co.il wrote:
 I was just wondering whether people enclosing their PHP tags declarations,
 I don't close these ?php tags just because the interpreter doesn't really
 needs them,
 and for the second reason - if a space/tab/new line/etc will beneath them it
 will cause
 problems with output buffering and session handling.

 Do you close your PHP ?php tags?

 (at least I closed them here :P look down)
 --
 ?
 Nitsan Bin-Nun
 Web Applications Developer
 nit...@binnun.co.il
 972-52-5722039


I only close tags inside templates.  All of my logic code is outside
of markup though so those files never have a closing ? for exactly
the reasons you stated.

-- 
http://www.voom.me | EFnet: #voom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread Per Jessen
Nitsan Bin-Nun wrote:

 I was just wondering whether people enclosing their PHP tags
 declarations, I don't close these ?php tags just because the
 interpreter doesn't really needs them,
 and for the second reason - if a space/tab/new line/etc will beneath
 them it will cause
 problems with output buffering and session handling.
 
 Do you close your PHP ?php tags?

Yes.


/Per Jessen, Zürich


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread John Corry
Same here.

They're just extraneous elements and can hide whitespace.

I leave them open in all applcation files and close them only in templates.



 I only close tags inside templates.  All of my logic code is outside
 of markup though so those files never have a closing ? for exactly
 the reasons you stated.

 --
 http://www.voom.me | EFnet: #voom

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread Edmund Hertle
2009/1/30 Eric Butera eric.but...@gmail.com

 On Fri, Jan 30, 2009 at 1:45 PM, Nitsan Bin-Nun nit...@binnun.co.il
 wrote:
  I was just wondering whether people enclosing their PHP tags
 declarations,
  I don't close these ?php tags just because the interpreter doesn't
 really
  needs them,
  and for the second reason - if a space/tab/new line/etc will beneath them
 it
  will cause
  problems with output buffering and session handling.
 
  Do you close your PHP ?php tags?
 
  (at least I closed them here :P look down)
  --
  ?
  Nitsan Bin-Nun
  Web Applications Developer
  nit...@binnun.co.il
  972-52-5722039
 

 I only close tags inside templates.  All of my logic code is outside
 of markup though so those files never have a closing ? for exactly
 the reasons you stated.


What is the problem in session handling? I think I came never across this
issue altough I do close my tags...


Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread Eric Butera
On Fri, Jan 30, 2009 at 3:50 PM, Edmund Hertle
edmund.her...@student.kit.edu wrote:
 What is the problem in session handling? I think I came never across this
 issue altough I do close my tags...

If there's any rogue whitespace in your file, it's sent to the browser
as the start of data.  So if you have an accidental space somewhere it
would prevent the session cookie header from being sent.  This also
would mess up setting cookies in general  header redirects.  Very,
very annoying when dealing with code that isn't yours and someone
wasn't as careful about it.

-- 
http://www.voom.me | EFnet: #voom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread mike
On Fri, Jan 30, 2009 at 12:50 PM, Edmund Hertle
edmund.her...@student.kit.edu wrote:

 What is the problem in session handling? I think I came never across this
 issue altough I do close my tags...


I think it depends if output buffering is on or not. If it is not
enabled, these linebreaks/etc. will be outputted before the session
header stuff is outputted.

That is a very interesting point though. Leaving it open allows for
human error (from time to time developers leave linebreaks in the
files ...)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread VamVan
On Fri, Jan 30, 2009 at 10:45 AM, Nitsan Bin-Nun nit...@binnun.co.ilwrote:

 I was just wondering whether people enclosing their PHP tags declarations,
 I don't close these ?php tags just because the interpreter doesn't really
 needs them,
 and for the second reason - if a space/tab/new line/etc will beneath them
 it
 will cause
 problems with output buffering and session handling.

 Do you close your PHP ?php tags?

 (at least I closed them here :P look down)


My suggestion don't close it.  Headers already sent is a big problem because
most of the time you see nothing but PHP Blank Of Death. If you don't have
access to tail ur log then its like a nightmare. I never understood this
error when I was a beginner.

Thanks,
V