<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Knowing a little more about PHP</title>
	<link>http://www.thyphp.com/knowing-a-little-more-about-php.html</link>
	<description>All about your PHP</description>
	<pubDate>Wed, 20 Aug 2008 00:55:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Eli</title>
		<link>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1747</link>
		<dc:creator>Eli</dc:creator>
		<pubDate>Wed, 30 Apr 2008 17:40:02 +0000</pubDate>
		<guid>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1747</guid>
		<description>Rasmus lead dev?? really?? not since php left perl.</description>
		<content:encoded><![CDATA[<p>Rasmus lead dev?? really?? not since php left perl.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kenman</title>
		<link>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1439</link>
		<dc:creator>kenman</dc:creator>
		<pubDate>Fri, 07 Mar 2008 03:41:20 +0000</pubDate>
		<guid>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1439</guid>
		<description>Actually, that probably wouldn't be much better. I think you'd be forced to change calling of the function itself:

safe_include( realpath('foo.php') );</description>
		<content:encoded><![CDATA[<p>Actually, that probably wouldn&#8217;t be much better. I think you&#8217;d be forced to change calling of the function itself:</p>
<p>safe_include( realpath(&#8217;foo.php&#8217;) );</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kenman</title>
		<link>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1438</link>
		<dc:creator>kenman</dc:creator>
		<pubDate>Fri, 07 Mar 2008 03:39:33 +0000</pubDate>
		<guid>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1438</guid>
		<description>Have you tested safe_include() much? I'm guessing it would fail for some cases in which a file with the same name is included, but from different directories (I know, this is typically poor form, but it sometimes happens).

I think this would be safer for situations such as that:

function safe_include($script) {
    static $included;
    $script = realpath($script);
    if ( ! isset($included[$script]) ) {
        include $script;
        $included[$script]=1;
    }
}</description>
		<content:encoded><![CDATA[<p>Have you tested safe_include() much? I&#8217;m guessing it would fail for some cases in which a file with the same name is included, but from different directories (I know, this is typically poor form, but it sometimes happens).</p>
<p>I think this would be safer for situations such as that:</p>
<p>function safe_include($script) {<br />
    static $included;<br />
    $script = realpath($script);<br />
    if ( ! isset($included[$script]) ) {<br />
        include $script;<br />
        $included[$script]=1;<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DH</title>
		<link>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1421</link>
		<dc:creator>DH</dc:creator>
		<pubDate>Thu, 06 Mar 2008 19:44:46 +0000</pubDate>
		<guid>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1421</guid>
		<description>"Premature optimization is the root of all evil."

I wouldn't do anything to avoid require_once() without some solid profiling data (e.g. XDebug) to show it would make an important difference.

And if you have a huge codebase where only small parts are active at a time, perhaps __autoload() would be more useful.</description>
		<content:encoded><![CDATA[<p>&#8220;Premature optimization is the root of all evil.&#8221;</p>
<p>I wouldn&#8217;t do anything to avoid require_once() without some solid profiling data (e.g. XDebug) to show it would make an important difference.</p>
<p>And if you have a huge codebase where only small parts are active at a time, perhaps __autoload() would be more useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anti Veeranna</title>
		<link>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1419</link>
		<dc:creator>Anti Veeranna</dc:creator>
		<pubDate>Thu, 06 Mar 2008 18:52:11 +0000</pubDate>
		<guid>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1419</guid>
		<description>Why not use autoload?

http://www.php.net/autoload</description>
		<content:encoded><![CDATA[<p>Why not use autoload?</p>
<p><a href="http://www.php.net/autoload" rel="nofollow">http://www.php.net/autoload</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cesar D. Rodas</title>
		<link>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1416</link>
		<dc:creator>Cesar D. Rodas</dc:creator>
		<pubDate>Thu, 06 Mar 2008 17:48:25 +0000</pubDate>
		<guid>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1416</guid>
		<description>Yes, you're right fluminis! 

thanks for the "bug" report</description>
		<content:encoded><![CDATA[<p>Yes, you&#8217;re right fluminis! </p>
<p>thanks for the &#8220;bug&#8221; report</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fluminis</title>
		<link>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1409</link>
		<dc:creator>fluminis</dc:creator>
		<pubDate>Thu, 06 Mar 2008 14:23:46 +0000</pubDate>
		<guid>http://www.thyphp.com/knowing-a-little-more-about-php.html#comment-1409</guid>
		<description>if ( defined(’SCRIPT_NAME’) ) {

seem's that you won't enter into the if.
maybe you think :
if ( ! defined(’SCRIPT_NAME’) ) {

nice post</description>
		<content:encoded><![CDATA[<p>if ( defined(’SCRIPT_NAME’) ) {</p>
<p>seem&#8217;s that you won&#8217;t enter into the if.<br />
maybe you think :<br />
if ( ! defined(’SCRIPT_NAME’) ) {</p>
<p>nice post</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.485 seconds -->
