Dateiformate

Alle Skripte in PEAR müssen:

  • als ASCII gespeichert werden.

  • mit dem Zeichensatz ISO-8859-1 kodiert werden.

  • den UNIX-Konventionen folgen.

    "Unix-Konventionen" bedeutet:

    • Zeilen dürfen nur mit dem Line-Feed-Zeichen (LF) enden. Das Zeichen entspricht dem Ordinal-Wert 10, Octal 012 und hexadezimal 0A. Benutzen Sie kein Carriage-Return-Zeichen (CR) wie unter Apple Macintosh-Computern oder die CRLF-Kombination unter Windows.

    • Fügen Sie ein Zeilenende-Zeichen nach dem schliessendem PHP-Tag (?>) ein. Das bedeutet, der Cursor im Editor steht eine Zeile nach dem schliessendem Tag.

Namens-Konventionen (Previous) E_STRICT-kompatibler Code (Next)
Last updated: Sun, 19 Dec 2010 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

Note by: kornel
I don't like these rules.

You require @author tag, and my name cannot be properly written in ASCII or ISO-8859-1. I think requirement of UTF-8 is much more reasonable these days.

Although "?>\n" is harmless, any accidentally added lines after that will be output and will cause trouble. I don't see any benefit in having "?>" and I see potential pitfalls, so IMHO it should be forbidden, rather than required.

Note by: wiesemann
shiplu.net..., you're wrong. The described line feeds are intended to not cause trouble e.g. with the header() or with session functions. Problems would arise only if there would be any more whitespace after the closing tag.
Note by: shiplu.net@gmail.com
LF after ?> is not a good idea.
It'll cause problem while working with headers.
I think this rule should be omitted.
Note by: gauthierm
cbrunet: Adding a single line-feed after the closing ?> does not cause headers to be sent. It is ignored by PHP.
Note by: cbrunet
Adding a LF after the last ?> could cause a problem to scripts that need to be executed before headers are sent. I will send a newline to the browser, causing headers to be send.
Note by: Dev
Whay not use the unicode utf-8 format?