<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 04:37:34 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: ZF2 Dependency Injection - Multiple Object Instances]]></title>
      <guid>http://www.phpdeveloper.org/news/17884</guid>
      <link>http://www.phpdeveloper.org/news/17884</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has <a href="http://www.eschrade.com/page/zf2-dependency-injection-multiple-object-instances">a quick new post</a> about using dependency injection in Zend Framework 2 applications using multiple object instances.
</p>
<blockquote>
When you work with the ZF2 Dependency Injection Container (DiC) when you make multiple requests for an instance of an object you will get the same object back each time. [...] But what if you want the injection benefits of the DiC but don't want to share the object?  Use the DiC's newInstance method instead with the third parameter being false.
</blockquote>
<p>
He includes code examples of requesting the object both ways - the usual way that returns the same object and the alternative that passes in a "false" value, complete with a <a href="http://php.net/var_dump">debug output</a> of each object proving they're different.
</p>]]></description>
      <pubDate>Mon, 30 Apr 2012 12:15:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Dan Horrigan's Blog: The Value of Null]]></title>
      <guid>http://www.phpdeveloper.org/news/16217</guid>
      <link>http://www.phpdeveloper.org/news/16217</link>
      <description><![CDATA[<p>
<i>Dan Horrigan</i> has a new post to his blog talking about <a href="http://coderepeat.com/post/4624154050/the-value-of-null">the value of null</a> - a quick summary about when and where null should be used. Null's a value too, after all...
</p>
<blockquote>
Let me start off by saying this article is about PHP and PHP alone.  Other languages handle this sort of thing differently (and better). In PHP many people (and a few frameworks) return FALSE from methods when the requested value does not exist.  However, I am here to tell you that if you do this, you are doing it wrong.  Plain and Simple.
</blockquote>
<p>
In his opinion, "false" is definitely not the same thing as "null" because "null" is technically the absence of a value, not a "not true" value like "false" is. He illustrates with a simple use case of a class that has methods returning various values. 
</p>]]></description>
      <pubDate>Tue, 19 Apr 2011 10:51:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrei Zmievski's Blog: Bloom Filters Quickie]]></title>
      <guid>http://www.phpdeveloper.org/news/12291</guid>
      <link>http://www.phpdeveloper.org/news/12291</link>
      <description><![CDATA[<p>
<i>Andrei Zmievski</i> has <a href="http://gravitonic.com/2009/04/bloom-filters-quickie">written a new post</a> about a new extension he's worked up (out of curiosity for the technology) - the <a href="http://pecl.php.net/package/bloomy">pecl/bloomy extension</a>.
</p>
<blockquote>
A Bloom filter is a probabilistic data structure that can be used to answer a simple question, is the given element a member of a set? Now, this question can be answered via other means, such as hash table or binary search trees. But the thing about Bloom filters is that they are incredibly space-efficient when the number of potential elements in the set is large.
</blockquote>
<p>
The filters allow false positives with a defined error rate - it gives the "yes" or "no" answer based on the content and you, the developer, decide if that answer falls within a rate that's okay for you and your app. The filters also take the same amount of time to look up items no matter how many are in the set.
</p>
<p>
He includes an example of the extension in use - defining the number of elements, the false positive allowance and adding/searching data and how the responses would come back from the checks. 
</p>]]></description>
      <pubDate>Tue, 07 Apr 2009 11:13:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: Return Values]]></title>
      <guid>http://www.phpdeveloper.org/news/11879</guid>
      <link>http://www.phpdeveloper.org/news/11879</link>
      <description><![CDATA[<p>
<i>Davey Shafik</i> has <a href="http://pixelated-dreams.com/archives/479-return-values.html">taken a look at return values</a> and keeping them standard when handing them back from the results of a database query.
</p>
<blockquote>
In #phpc we recently had a discussion about function return values; specifically from database queries. I'm going to go on a (admittedly, rather sturdy looking) limb and say this applies to pretty much any function that returns from a data resource, not just a database .
</blockquote>
<p>
His personal preference is to return the results data if there's matching information but to return a false value if there is an error/not results were found. He includes a snippet of example code to show the structure he's talking about. Some of <a href="http://pixelated-dreams.com/archives/479-return-values.html#comments">the comments</a> on the post mention things like exception handling, other similar methods other developers use and the use of nulls.
</p>]]></description>
      <pubDate>Wed, 04 Feb 2009 11:14:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: False == 0, or not?]]></title>
      <guid>http://www.phpdeveloper.org/news/8446</guid>
      <link>http://www.phpdeveloper.org/news/8446</link>
      <description><![CDATA[<p>
<i>Felix Geisendorfer</i> has <a href="http://www.thinkingphp.org/2007/08/13/false-0-or-not/">come across something interesting</a> in his coding - an issue where false might not be false in the right situation.
</p>
<blockquote>
So far I've always thought false would evaluate to 0 when used in a computational context. Turns out that this isn't always the case.
</blockquote>
<p>
His <a href="http://www.thinkingphp.org/2007/08/13/false-0-or-not/">code example</a> tries to check is a false value is greater than or equal to a negative number. The result, however (despite the thinking that false is a zero value) turns out to be false.
</p>
<blockquote>
I randomly stumbled upon this when arguing with Mariano today if setting Model::recursive to 'false' has the same effect as setting it to '-1'. Turns out that cake uses a statement like this: if ($recursive > -1) in the core which in turn makes -1 and false do exactly the same thing.
</blockquote>]]></description>
      <pubDate>Tue, 14 Aug 2007 08:45:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tiffany Brown's Blog: PHP Quickie: More on is_numeric vs. ctype_digit]]></title>
      <guid>http://www.phpdeveloper.org/news/6063</guid>
      <link>http://www.phpdeveloper.org/news/6063</link>
      <description><![CDATA[<p>
<i>Tiffany Brown</i> has <a href="http://tiffanybbrown.com/viewqb.php/734">posted an update</a> to her look into is_numeric versus ctype_digit today, mentioning an issue she came across when testing based on the differences <a href="http://www.phpdeveloper.org/news/5899">she found</a> in her previous posting.
</p>
<blockquote>
<p>
Just a quick follow-up to my post on <a href="http://tiffanybbrown.com/viewqb.php/709">is_numeric vs. ctype_digit</a>. There is one quirk with ctype_digit that may affect your choice about whether to use it.
</p>
<p>
When the string in question is empty, ctype_digit returns TRUE. However, when it is null, ctype_digit will return FALSE.
</p>
</blockquote>
<p>
She <a href="http://tiffanybbrown.com/viewqb.php/734">includes code</a> to illustrate, noting the return of each function.
</p>]]></description>
      <pubDate>Thu, 17 Aug 2006 07:32:52 -0500</pubDate>
    </item>
  </channel>
</rss>
