ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Three-Tier Development with PHP 5
Subject:   Sorry to be picky but...
Date:   2004-12-28 02:59:06
From:   HarryF
Like the article overall and great to see layered application design being encouraged. Have to scratch some itches though...


Please modify the examples on the second page so they use full PHP processing instruction declarations i.e.;



<?php
</code>


not;



<?
</code>


In php.ini there's an option called "short_open_tag". The later form; <?</code> is only possible when short_open_tag is On, so the examples will not work for those that have it switched off, potentially reducing the portability of the code, across different PHP installations.


Also include, require, require_once etc. are language constructs not functions so although the parenthesis is allowed, it's generally better form to write;



include 'somefile.php';


It's also better practice (ignoring any performance issues) to always use require_once when including class files, to take care of the situations where, say, multiple child classes in seperate files all attempt to include the same parent class script.