<?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>Sun, 12 Feb 2012 19:29:18 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Timothy Boronczyk's Blog: Avoid Fetch-Object Abuse]]></title>
      <guid>http://www.phpdeveloper.org/news/16581</guid>
      <link>http://www.phpdeveloper.org/news/16581</link>
      <description><![CDATA[<p>
In a new post on his blog <i>Timothy Boronczyk</i> has a recommendation for developers working in PHP with databases that have a "fetch object" method - <a href="http://zaemis.blogspot.com/2011/07/avoid-fetch-object-abuse.html">use it correctly or avoid it all together</a>.
</p>
<blockquote>
Lately I'm finding a lot of instances of the mysql_fetch_object() function being used in a particular codebase I help maintain. Unfortunately, I've yet to see it used correctly. It always seems to be used to retrieve a stdClass object from a query result where mysql_fetch_array() or mysql_fetch_assoc() would be the more appropriate choice.
</blockquote>
<p>
Most of his complaint is that, despite pulling out the data as an object, most scripts continue to use it like you would an array, looping over it. There's extra overhead generated from the object creation that could cause issues, especially with large return data sets.
</p>
<blockquote>
The best advice I can offer is to educate yourself and others how the function should be used so its abuse isn't perpetuated. Then, be cautious when using mysql_fetch_object() correctly and understand the process it follows to create and return an object. If not for yourself, then do it for the kittens.
</blockquote>]]></description>
      <pubDate>Tue, 12 Jul 2011 12:10:02 -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[CodeForest.net: Key/value tables and how to use them in PHP and MySQL]]></title>
      <guid>http://www.phpdeveloper.org/news/15111</guid>
      <link>http://www.phpdeveloper.org/news/15111</link>
      <description><![CDATA[<p>
On the CodeForest site there's <a href="http://www.codeforest.net/keyvalue-tables-and-how-to-use-them-in-php-and-mysql">a recent tutorial</a> that offers a different option for those dealing with an application that has the possibility for rapid change in its database structure - a key/value table in a standard relational database (no, not NoSQL).
</p>
<blockquote>
Key/value approach in database design could come in handy when we need to store some arbitrary data about another table. For example, we have a users table that holds our user data. Everything is working fine, but some day our client decides that he wants to collect 2 telephone numbers, sex of the user, date of birth... If we try to predefine all the potential wishes of the customer in our table, it would be awkward and our table would grow horizontally beyond reason.
</blockquote>
<p>
He compares the traditional "users" table with each column a defined type of data against a key/value table where each record holds both the value and a key relating to its contents. While this technique can be flexible, it can also be abused if it gets out of control. <i>Bill Karwin</i> warns <a href="http://www.codeforest.net/keyvalue-tables-and-how-to-use-them-in-php-and-mysql#comments">in the comments</a> about it and links to <a href="http://www.simple-talk.com/opinion/opinion-pieces/bad-carma/">two</a> <a href="http://www.simple-talk.com/sql/t-sql-programming/avoiding-the-eav-of-destruction/">resources</a> on its use.
</p>]]></description>
      <pubDate>Fri, 10 Sep 2010 12:36:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Roane's Blog: Should PHP web programmers go to college?]]></title>
      <guid>http://www.phpdeveloper.org/news/15083</guid>
      <link>http://www.phpdeveloper.org/news/15083</link>
      <description><![CDATA[<p>
<i>Chris Roane</i> has <a href="http://www.montanaprogrammer.com/php-web-programming/should-php-web-programmers-go-to-college/">a new post to his blog</a> asking an interesting question - should PHP programmers/developers spend the time to go to college?
</p>
<blockquote>
A common debate in our field is whether or not a college education is worth it when becoming a PHP programmer. People will throw statistics in how much more money you can make with a college degree. But is the cost of college (time + tuition) for a four year degree better than the benefits of having four years of experience in the web programming field?
</blockquote>
<p>
He qualifies it with the fact that not all college educations are created equal and that it depends on the student as to what they get out of it. He breaks it up into a few different sections with reasoning in each:
</p>
<ul>
<li>The Benefits of Going to College
<li>The Cost of Going to College
<li>The Benefits of a PHP Programmer Not Going to College
<li>The Negative Aspects of a PHP Programmer Skipping College
</ul>]]></description>
      <pubDate>Mon, 06 Sep 2010 12:09:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Roane's Blog: Analyzing the Value of a PHP Programmer]]></title>
      <guid>http://www.phpdeveloper.org/news/14262</guid>
      <link>http://www.phpdeveloper.org/news/14262</link>
      <description><![CDATA[<p>
On his MontanaProgrammer.com blog <i>Chris Roane</i> looks at the <a href="http://www.montanaprogrammer.com/php-web-programming/analyzing-php-programmers/">value of a PHP programmer</a> and what you might look for when considering which developers could make the most difference.
</p>
<blockquote>
Over the years I have come across PHP programmers from different backgrounds. I've seen some do very well, and others fall flat on their faces. One unique element about PHP programmers is that they vary in quality more than most other programming professions.
</blockquote>
<p>
He mentions traits to consider like speed of coding, reliability, experience, humility and be able to accurately estimate time to finish work. He give the example of three different developers - each with their own skills and experience levels and asks which of these might be the best. The trick is, "best" is very subjective to the needs of the company that wants the code written.
</p>]]></description>
      <pubDate>Mon, 29 Mar 2010 12:56:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: Latest Release of Rediska]]></title>
      <guid>http://www.phpdeveloper.org/news/13595</guid>
      <link>http://www.phpdeveloper.org/news/13595</link>
      <description><![CDATA[<p>
A new version of the <a href="http://rediska.geometria-lab.net/">Rediska</a> library has been released today, version 0.2.1. Rediska is a PHP client for <a href="http://code.google.com/p/redis/">Redia</a>, a key/value database system (written in C) that's similar to memcache.
</p>
<blockquote>
It can be used like memcached, in front of a traditional database, or on its own thanks to the fact that the in-memory datasets are not volatile but instead persisted on disk. One of the cool features is that you can store not only strings, but lists and sets supporting atomic operations to push/pop elements.
</blockquote>
<p>
The library includes multiple server support, content hashing, keys as objects and full Zend Framework integration. You can find out more about the project on <a href="http://rediska.geometria-lab.net/">its site</a> or just <a href="http://rediska.geometria-lab.net/download">download the latest version</a>.
</p>]]></description>
      <pubDate>Thu, 26 Nov 2009 18:38:05 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Checking Boolean Values with Filters in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/12966</guid>
      <link>http://www.phpdeveloper.org/news/12966</link>
      <description><![CDATA[<p>
DevShed continues their look at filtering in PHP5 applications with <a href="http://www.devshed.com/c/a/PHP/Checking-Boolean-Values-with-Filters-in-PHP-5">this third part</a> covering checks on boolean values.
</p>
<blockquote>
As I said before, the filter extension can be used for more than validating integers, since it provides the required functionality to checking other data types. Thus, in the next few lines I'm going to discuss how to use the extension for validating Boolean values.
</blockquote>
<p>
They give a <a href="http://www.devshed.com/c/a/PHP/Checking-Boolean-Values-with-Filters-in-PHP-5/2/">few lines of example code</a> to show how different values (like "1" versus 1 and "true" versus true) are affected by PHP's dynamic typing.
</p>]]></description>
      <pubDate>Thu, 30 Jul 2009 09:09:12 -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[Brian Moon's Blog: Null vs. isset()]]></title>
      <guid>http://www.phpdeveloper.org/news/11837</guid>
      <link>http://www.phpdeveloper.org/news/11837</link>
      <description><![CDATA[<p>
In <a href="http://brian.moonspot.net/null-isset-php">this new post</a> to his blog, <i>Brian Moon</i> compares two things that, on the outside, might seem a lot alike but do have their differences under the hood - a null value and the <a href="http://php.net/isset">isset</a> function.
</p>
<blockquote>
I am working with a newcomer to PHP and he asked me about setting a variable to null and how to check that.  He had found some example or information that showed that setting a varaible equal to null would unset the variable. So, he was unclear if he could then reliably check if the variable was equal to null.  Having avoided null like the plague in my years of PHP, I was not sure. So, I mocked up a quick script to see what the states of a variable are in relation to null.
</blockquote>
<p>
His test verified that a variable, set equal to null will be found to be equal to null, will be set (<a href="http://php.net/isset">isset</a>) and will be found empty by PHP's <a href="http://php.net/empty">empty</a>
</p>]]></description>
      <pubDate>Thu, 29 Jan 2009 09:34:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer's Blog: Validating POST fields the easy way]]></title>
      <guid>http://www.phpdeveloper.org/news/11575</guid>
      <link>http://www.phpdeveloper.org/news/11575</link>
      <description><![CDATA[<p>
<i>Sameer</i> has posted his "<a href="http://www.codediesel.com/php/validating-post-fields-the-easy-way/">easy way</a>" to validate user input coming in over a POST request:
</p>
<blockquote>
Validating POST data from a form is a common requirement for a developer. If the number of form fields are few than the validation is a small matter. But the case is different when the form contains more than 15 or 20 fields and some of the fields are mandatory. The following code will give you an idea of how to easily validate mandatory fields, whatever the number of fields.
</blockquote>
<p>
His method prefixes the form fields with a certain string (in his case "c_") and uses that to loop through and act as a hook to check only the form values that were submitted (and nothing else that happens to be in the $_POST array). Any number of checks could be added on to this simple example including type checks, length and validating off of another field - like a password confirm match.
</p>]]></description>
      <pubDate>Mon, 15 Dec 2008 16:44:17 -0600</pubDate>
    </item>
  </channel>
</rss>

