Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
Start/end tags

Start/end tags

The first thing you probably will notice is that PHP's start and end tags have changed. The old <? > form has been replaced by three new possible forms:

Example D-1. Migration: old start/end tags

&#60;? echo "This is PHP/FI 2.0 code.\n"; &#62;
As of version 2.0, PHP/FI also supports this variation:

Example D-2. Migration: first new start/end tags

&#60;? echo "This is PHP 3.0 code!\n"; ?&#62;
Notice that the end tag now consists of a question mark and a greater-than character instead of just greater-than. However, if you plan on using XML on your server, you will get problems with the first new variant, because PHP may try to execute the XML markup in XML documents as PHP code. Because of this, the following variation was introduced:

Example D-3. Migration: second new start/end tags

&#60;?php echo "This is PHP 3.0 code!\n"; ?&#62;
Some people have had problems with editors that don't understand the processing instruction tags at all. Microsoft FrontPage is one such editor, and as a workaround for these, the following variation was introduced as well:

Example D-4. Migration: third new start/end tags

&#60;script language="php"&#62;

  echo "This is PHP 3.0 code!\n";

&#60;/script&#62;