<?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>Tue, 21 May 2013 15:40:40 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jani Hartikainen: Parsing and evaluating PHP in Haskell: Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19079</guid>
      <link>http://www.phpdeveloper.org/news/19079</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has posted the <a href="http://codeutopia.net/blog/2013/01/23/parsing-and-evaluating-php-in-haskell-part-2/">second article</a> in his series looking at parsing PHP with Haskell (part one is <a href="http://phpdeveloper.org/news/19052">here</a>). In this new article he builds on the parser he built last time and gets to the actual evaluation of the PHP code.
</p>
<blockquote>
Last week I wrote a post about a PHP parser / evaluator I wrote in Haskell. I explained some of the parts on how the parser itself was designed to process PHP code into an abstract source tree. Continuing from where we left off in the <a href="http://codeutopia.net/blog/2013/01/16/parsing-and-evaluating-php-in-haskell-part-1/">previous part</a>, in this post I'll discuss the actual evaluation part.
</blockquote>
<p>
He starts by introducing the structure of the evaluator script, how it's broken up into functionality based on the type of object/data type being handled. He uses a "custom monad transformer stack" to handle the environment for the evaluation as is progresses. He talks about handling statements and expressions, declaring custom functions and the actual execution of the function call. There's also a mention of handling conditionals/looping as well as dealing with PHP's type juggling. 
</p>
<p>
if you're interested in seeing the final result (and maybe trying it out for yourself) you can find the <a href="https://github.com/jhartikainen/hs-language-php">full source on Github</a>.
</p>]]></description>
      <pubDate>Wed, 23 Jan 2013 11:24:34 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Numeric string comparison in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16249</guid>
      <link>http://www.phpdeveloper.org/news/16249</link>
      <description><![CDATA[<p>
In <a href="http://www.rooftopsolutions.nl/blog/numeric-string-comparison-in-php">this new post</a> to his blog <i>Evert Pot</i> reminds you (the PHP developer) about the loose and strict typing checks that you need to do when checking the values of your variables and never just assume. PHP's loose typing tendencies can cause issues if you're not paying attention.
</p>
<blockquote>
As long as you make sure you always use strict checking (=== and !==) where you can, and fall back to the loose checks when you must. As a PHP developer, I think it's very important to understand and memorize exactly how these work, whether you're writing new code, or maintaining existing code.
</blockquote>
<p>
He points out a specific example of some code that seems counter-intuitive when you compare how it reads and how it actually works (strings converted to floats and evaluated)
</p>
<blockquote>
The moral is: always do strict checks when you are able to.
</blockquote>]]></description>
      <pubDate>Tue, 26 Apr 2011 09:23:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ian Barber's Blog: Benford's Law]]></title>
      <guid>http://www.phpdeveloper.org/news/16147</guid>
      <link>http://www.phpdeveloper.org/news/16147</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Ian Barber</i> looks at <a href="http://phpir.com/benfords-law">applying Benford's Law in PHP</a> to determine if the dataset you're working with is "real" or not.
</p>
<blockquote>
Benfords Law is not an exciting new John Nettles based detective show, but an interesting observation about the distribution of the first digit in sets of numbers originating from various processes. It says, roughly, that in a big collection of data you should expect to see a number starting with 1 about 30% of the time, but starting with 9 only about 5% of the time.
</blockquote>
<p>
He pulls data from <a href="http://data.gov.uk/dataset/financial-transactions-data-science-and-technology-facilities-council">the data.uk.gov site</a> to illustrate and includes a simple PHP script to run through the data looking scoring it with a "Benford" rating. He plots these on a graph along side the data to show the (almost exact) match between the data and the Benford numbers. You can find more details on the law <a href="http://en.wikipedia.org/wiki/Benford%27s_law">on Wikipedia</a>.
</p>]]></description>
      <pubDate>Tue, 05 Apr 2011 09:12:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: How to (properly) evaluate Zend Server - Introduction]]></title>
      <guid>http://www.phpdeveloper.org/news/15058</guid>
      <link>http://www.phpdeveloper.org/news/15058</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has <a href="http://www.eschrade.com/page/properly-evaluate-zend-server-part-4c7d75fb">a new post to his blog</a> today on how to correctly evaluate the <a href="http://www.zend.com/en/products/server/">Zend Server</a> product from <a href="http://zend.com">Zend</a> (disclaimer: he is a Zend employee).
</p>
<blockquote>
As you all probably know, Zend has salespeople.  Those sales people have sales engineers who show how to use our products.  However, I personally hate being on the phone for a canned presentation when all I really want to do is tinker.  So, in an effort to produce something of benefit today I decided to start a series of blog posts on how to evaluate Zend Server if you are a tinkerer, like me.
</blockquote>
<p>
He gives a list of some of the features that the product comes with, but will only really focus on three of them in his series - application monitoring, code tracing and the Zend Server job queue (because he thinks they're the best of the crop). This post is just an introduction to the product and an overview of what it offers - expect more detail to come in future posts.
</p>]]></description>
      <pubDate>Wed, 01 Sep 2010 10:36:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mutant PHP Blog: Specifications for PHP5]]></title>
      <guid>http://www.phpdeveloper.org/news/11117</guid>
      <link>http://www.phpdeveloper.org/news/11117</link>
      <description><![CDATA[<p>
In a <a href="http://mutantphp.org/blog/2008/09/25/specifications-for-php5/">recent entry</a> to his blog <i>Sean</i> shows off a new <a href="http://mutantphp.org/blog/wp-content/downloads/Specifications.zip">specifications library</a> he's created to replace common comparison functionality with a series of specs.
</p>
<blockquote>
I thought I'd share a PHP library implementing <a href="http://martinfowler.com/apsupp/spec.pdf">this</a> idea by Evans and Fowler. Written for PHP5, it's a library for defining custom specifications using composition and inheritance.
</blockquote>
<p>
He gives the example of "Person" objects with name and age properties. A search might involve looking directly at the properties to location one that's, say, younger than 35 and has a last name of Johnson. His specification class replaces this and makes it more reusable by applying things like GreaterOrEqualSpecifications and EqualSpecifications to standardize the evaluation. Then its just a quick call to the isSatisfiedBy method to check for correctness.
</p>]]></description>
      <pubDate>Tue, 30 Sep 2008 11:17:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: The Ternary Conditional Operator]]></title>
      <guid>http://www.phpdeveloper.org/news/9760</guid>
      <link>http://www.phpdeveloper.org/news/9760</link>
      <description><![CDATA[<p>
The PHPBuilder.com site has a <a href="http://www.phpbuilder.com/columns/scross99_20080305.php3">quick reminder</a> about a handy little bit of functionality PHP has to make evaluations quicker - the ternary operator.
</p>
<blockquote>
This allows you to check for the existence of a variable (or check that the variable has a valid value) and assign a value accordingly. This is very useful when you are dealing with $_GET, $_POST, $_SESSION etc. variables, because you don't know whether the incoming variable will exist, and if it doesn't you might want to assign a default value. 
</blockquote>
<p>
An example is included and explained - evaluating an index in the _GET superglobal to see if it exists. It returns either the value itself or a false.
</p>]]></description>
      <pubDate>Fri, 07 Mar 2008 12:04:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Thompson's Blog: Switch vs. If]]></title>
      <guid>http://www.phpdeveloper.org/news/9549</guid>
      <link>http://www.phpdeveloper.org/news/9549</link>
      <description><![CDATA[<p>
<i>Rob Thompson</i> has <a href="http://rob.sun3.org/php-code/switch-vs-if/">posted about</a> some simple benchmarking he did comparing the speed of a series of "if" statements versus one "switch" with multiple cases.
</p>
<blockquote>
I got curious about which is actually more efficient at matching a random integer with a set of conditionals. So, I setup a script to create a set of large scripts to test the speed of these different constructs. Using the 'time' command, I measured the speed at which the condition could match a random number.
</blockquote>
<p>
His results found that the switch statement is generally more than 2 times as fast at matching a simple integer. His tests, however, didn't go through much more than this simple test. It'd be interesting to see what it would do with something more complex (like longer strings or handling the result of an evaluation inside the definition of the switch().
</p>]]></description>
      <pubDate>Fri, 01 Feb 2008 14:28:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Padraic Brady's Blog: Any Behaviour-Driven Development Tools for PHP?]]></title>
      <guid>http://www.phpdeveloper.org/news/8690</guid>
      <link>http://www.phpdeveloper.org/news/8690</link>
      <description><![CDATA[<p>
In a <a href="http://blog.astrumfutura.com/archives/306-Any-Behaviour-Driven-Development-Tools-for-PHP.html">new post</a> today, <i>Padraic Brady</i> asks the community for any kind of input as to what they've seen for behaviour-driven development in PHP:
</p>
<blockquote>
Behavior-Driven Development (BDD) is an evolution of Test-Driven Development (TDD) which pushes the focus away from the concept of testing to one of specifying behaviours in a form more easily understood.
</blockquote>
<p>
In asking about any of the tools that might happen to be out there, he also <a href="http://blog.astrumfutura.com/archives/306-Any-Behaviour-Driven-Development-Tools-for-PHP.html">gives an example</a> (from a Ruby perspective) on how the behaviour-driven method is put into practice. The code describes the behaviour by what "it should" do and evaluates based on that.
</p>]]></description>
      <pubDate>Thu, 20 Sep 2007 08:48:00 -0500</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[Dhani's Blog: Creating Guest Book with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/5653</guid>
      <link>http://www.phpdeveloper.org/news/5653</link>
      <description><![CDATA[<p>
From <i>Dhani</i>'s blog today, there's <a href="http://www.dhani.mbojo.com/2006/06/22/creating-guest-book-with-php/">this new tutorial</a> (part 1) showing you how to create a guest book for your site with PHP's help.
</p>
<blockquote>
<p>
Proper development on any kind of project requires you to stop and evaluate the project before development begins (hopefully long before, but that's not always the case). 
</p>
<p>
Having said that, let's figure out what we want the guestbook to do. What's the guestbook for? In this case, it's simply to let users view other visitor's comments and to add their own. The guestbook is not a stand alone application - well it is, but it exists in the context of the web site
</p>
</blockquote>
<p>
There's a <a href="http://www.dhani.mbojo.com/2006/06/22/creating-guest-book-with-php/">few considerations</a> mentioned before the code comes along (broken up into the business and technical sections). With the plan in place, <I>Dhani</i> shows the database layout chosen, the reasoning behind it, and the actual SQL you'll need to create it.
</p>]]></description>
      <pubDate>Thu, 22 Jun 2006 06:00:12 -0500</pubDate>
    </item>
  </channel>
</rss>
