<?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>Sat, 25 May 2013 11:18:32 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Nikita Popov's Blog: Scalar type hinting is harder than you think]]></title>
      <guid>http://www.phpdeveloper.org/news/17638</guid>
      <link>http://www.phpdeveloper.org/news/17638</link>
      <description><![CDATA[<p>
In <a href="http://nikic.github.com/2012/03/06/Scalar-type-hinting-is-harder-than-you-think">this new post</a> to his blog <i>Nikita</i> talks about scalar type hinting and why it's harder than most people think to accomplish.
</p>
<blockquote>
One of the features originally planned for PHP 5.4 was scalar type hinting. But as you know, they weren't included in the release. Recently the topic has come up again on the mailing list and there has been a hell lot of discussion about it. Yesterday ircmaxell published a <a href="http://blog.ircmaxell.com/2012/03/parameter-type-casting-in-php.html">blog post about his particular proposals</a>. The reactions on <a href="http://www.reddit.com/r/PHP/comments/qiniv/parameter_type_casting_in_php/">reddit</a> were mixed. On one hand it is clear that people do really want scalar type hints, on the other hand they didn't seem to like that particular proposal.
</blockquote>
<p>
He gets into some of the details of some of the current proposals and their problems like the strict versus loosely-typed nature of PHP and type hinting that was included but not enforced. One he does like, however, is one based on casting - how the variable ends up being cast rather than the specific type it is when it comes into the function/method. This one still has its flaws, so he suggests another method - weak type hints but with stricter input validation (without casting). He also briefly mentions something called "box based type hinting" that would allow users to define their own hinting rules.
</p>
<p>
Don't worry - code examples (pseudo-code obviously) <a href="http://nikic.github.com/2012/03/06/Scalar-type-hinting-is-harder-than-you-think">are included</a> for each of these proposals to help you understand the differences.
</p>]]></description>
      <pubDate>Wed, 07 Mar 2012 10:03:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Declaring Static Methods in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15561</guid>
      <link>http://www.phpdeveloper.org/news/15561</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has a new post to her blog today <a href="http://www.lornajane.net/posts/2010/Declaring-Static-Methods-in-PHP">talking about static methods</a> and how to use them correctly in your code (as discovered accidentally in her own code).
</p>
<blockquote>
I was confused recently to realise that I had accidentally called a static method in PHP dynamically from another part of my code; I expected PHP to output warnings when this is done. On closer inspection I discovered that: static functions can be called dynamically and dynamic functions generate an E_STRICT error if called statically.
</blockquote>
<p>
She illustrates with some sample code that, when run with E_ALL and E_STRICT throws a warning from the strict side about calling a non-static method statically. She also talks about why it throws this warning for the non-static call on a static method. She also explains why, when a static method is called dynamically, no warning is thrown.
</p>]]></description>
      <pubDate>Fri, 10 Dec 2010 08:40:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Turland's Blog: The Yin and Yang of Typing]]></title>
      <guid>http://www.phpdeveloper.org/news/9546</guid>
      <link>http://www.phpdeveloper.org/news/9546</link>
      <description><![CDATA[<p>
A little while back <i>Matthew Turland</i> <a href="http://ishouldbecoding.com/2008/01/19/the-yin-and-yang-of-typing/">posted about</a> something that some developers moving over to PHP from more strict languages have an issue with - variable typing - and how its evolved in languages over time.
</p>
<blockquote>
Without a little background in programming languages or computer science in general, it's entirely possible that <a href="http://en.wikipedia.org/wiki/Type_system">typing systems</a> are not something that have crossed your mind. I thought I'd take a blog entry to share some of my thoughts on how it's affecting the creation and evolution of languages.
</blockquote>
<p>
He walks through history a bit, mentioning C, Java, Python and PHP and how they differ in their default type handling. He especially focuses on the "blurred line" between strong and weak typing and how some if offers special features to the language that uses the method.
</p>]]></description>
      <pubDate>Fri, 01 Feb 2008 11:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Clay Loveless' Blog: PHP and JSON: Cut #987]]></title>
      <guid>http://www.phpdeveloper.org/news/7364</guid>
      <link>http://www.phpdeveloper.org/news/7364</link>
      <description><![CDATA[<p>
In a <a href="http://killersoft.com/randomstrings/2007/02/28/php-and-json-cut-987/">new post</a> today, <i>Clay Loveless</i> talks about some issues he's been having with PHP and JSON, specifically with the JSON encoding method in PHP 5.2.1.
</p>
<blockquote>
As of PHP 5.2.1, json_decode() no longer follows <a href="http://www.ietf.org/rfc/rfc4627.txt">the published standards</a> for JSON-encoded texts. Why not? For no reason other than the convenience of those ignorant of JSON standards.
</blockquote>
<p>
His complaint stems from the results of a vat_dump statement - prior to this version it would give a NULL, but now it returns a "bool(true)" value back, resulting in some breakage of previous scripts. He spends the rest of the post explaining his voyage through the JSON world and how things are supposed to behave. He also digs a little deeper into the var_dump issue and why he thinks it's such a bad thing.
</p>]]></description>
      <pubDate>Thu, 01 Mar 2007 08:43:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: How-to: Use Html 4.01 in CakePHP 1.2]]></title>
      <guid>http://www.phpdeveloper.org/news/7326</guid>
      <link>http://www.phpdeveloper.org/news/7326</link>
      <description><![CDATA[<p>
<i>Felix Geisendorfer</i> has a <a href="http://www.thinkingphp.org/2007/02/21/use-html-401-in-cakephp-12/">"quick hit"</a> tip posted to his blog today on using HTML 4.0.1 in your CakePHP 1.2 installation.
</p>
<blockquote>
This is just a little tip for those of you who dislike their xhtml to end up as tag soup and still prefer to send out Html 4.01 strict. Here is how to make all helper functions in Cake 1.2 output Html 4.01 compliant markup instead of xhtml.
</blockquote>
<p>
The <a href="http://www.thinkingphp.org/2007/02/21/use-html-401-in-cakephp-12/">helper he's created</a> just loops through the entire $tags array and does a replace on the greater-than sign to add a slash to make it compliant.
</p>]]></description>
      <pubDate>Thu, 22 Feb 2007 08:35:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: How strict is your dynamic language?]]></title>
      <guid>http://www.phpdeveloper.org/news/5886</guid>
      <link>http://www.phpdeveloper.org/news/5886</link>
      <description><![CDATA[<p>
<i>Harry Fuecks</i> wonders in <a href="http://www.sitepoint.com/blogs/2006/07/27/how-strict-is-your-dynamic-language/">this new post</a> on the SitePoint PHP Blog "how strict is your dynamic language?"
</p>
<blockquote>
Considering the "big four" dynamic, procedural languages; Perl, Python, PHP and Ruby, to an extent they're much of a muchness, offering only small variations on the same theme (ignoring PHP's lack of support for functional-style programming). But sometimes little things make a big difference, and perhaps most of all when your code is given input to handle which it wasn't designed for. Knocked up a simple example to compare them in this area...
</blockquote>
<p>
He <a href="http://www.sitepoint.com/blogs/2006/07/27/how-strict-is-your-dynamic-language/">compares four languages</a> - Perl, PHP, Ruby, and Python - by giving, for each, code examples and what the output would be, including what would error out. These examples help to illustrate his final points:
<ul>
<li>where is the point when a fatal error should be raised? 
<li>what is it the languages should actually complain about?
</ul>
</p>]]></description>
      <pubDate>Thu, 27 Jul 2006 06:00:58 -0500</pubDate>
    </item>
  </channel>
</rss>
