<?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>Thu, 04 Dec 2008 14:20:57 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: Serialize Python Variables To PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11266</guid>
      <link>http://www.phpdeveloper.org/news/11266</link>
      <description><![CDATA[<p>
As a part of a current project <i>Daniel Cousineau</i> came across the need to bridge two languages - PHP and Python - via some serialized variables. <a href="http://www.toosweettobesour.com/2008/10/22/serialize-python-variables-to-php/">This new post</a> on his blog shows how he did it.
</p>
<blockquote>
So I'm in the planning stages of a project where I'll probably be doing some heavy lifting in Python and serving up the output through PHP. Obviously this will entail transmitting data between Python and PHP and while I haven't had a chance to do performance testing to see if it's worth it to save to a database, the only other option was to serialize the data to a file that PHP could parse quickly. Obviously, the output from serialize() is going to be the fastest way to recieved the data.
</blockquote>
<p>
As he was working on his own implementation, he came across a currently existing Python library (that adds the serialize support) and but found it lacking for what he needed. He continued on, working up <a href="http://github.com/dcousineau/phpserialize/tree/master">his own</a> customized implementation with all the features he needed. He includes both the Python and PHP code (cut and paste ready) as well as the results from the serialization of different data types.
</p>]]></description>
      <pubDate>Wed, 22 Oct 2008 08:47:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Static/Dynamic typing sweet spot]]></title>
      <guid>http://www.phpdeveloper.org/news/11168</guid>
      <link>http://www.phpdeveloper.org/news/11168</link>
      <description><![CDATA[<p>
In a <a href="http://codeutopia.net/blog/2008/10/08/staticdynamic-typing-sweet-spot/">new post</a> today <i>Jani Hartikainen</i> takes a look at one of the things that makes PHP both powerful and unpredictable at times - its variable typing, static versus dynamic.
</p>
<blockquote>
It seems that PHP has moved a bit towards static typing, and languages like C# seem to be implementing some dynamic features. Are we going towards a "mixed" language with static and dynamic typing? What's the "sweet spot" between completely static (like C++) and completely dynamic typing (like Python)?
</blockquote>
<p>
He compares the benefits of static and dynamic, and a particular place where PHP falls a bit flat - type hinting in certain situations. He agrees, though, that dynamic typing is "the way to go" since it gives the developer the flexibility they might need for more "typing tricks" in their apps. Oh, and "duck typing"...
</p>]]></description>
      <pubDate>Wed, 08 Oct 2008 10:24:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[David Otton's Blog: Stupid PHP Tricks: Illegal Variable Names]]></title>
      <guid>http://www.phpdeveloper.org/news/10885</guid>
      <link>http://www.phpdeveloper.org/news/10885</link>
      <description><![CDATA[<p>
<i>David Otton</i> has shared another of his "stupid PHP tricks" on his blog today. <A href="http://www.otton.org/2008/08/21/stupid-php-tricks-illegal-variable-names/">This one</a> looks at illegal variable names that don't match the "can't start with a number" rule the manual points out.
</p>
<blockquote>
A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*'
</blockquote>
<p>
Technically, you can get around this in two different ways - variable varaibles and the more complex notation with curly braces. He points to the <a href="http://www.php.net/compact">compact</a> function for proof that they're set.
</p>]]></description>
      <pubDate>Fri, 22 Aug 2008 13:47:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: Global Variables and PHPUnit]]></title>
      <guid>http://www.phpdeveloper.org/news/10424</guid>
      <link>http://www.phpdeveloper.org/news/10424</link>
      <description><![CDATA[<p>
<i>Sebastian Bergmann</i> has a <a href="http://sebastian-bergmann.de/archives/797-Global-Variables-and-PHPUnit.html">new post</a> today about a feature of the PHPUnit unit testing tool that has the possibility of breaking when objects are introduced - backing up the globals.
</p>
<blockquote>
It is hard to test code that uses singletons. The same is true for code that uses global variables. Typically, the code you want to test is coupled strongly with a global variable and you cannot control its creation. An additional problem is the fact that one test's change to a global variable might break another test.
</blockquote>
<p>
You can disable the backup option if you'd like by setting the $backupGlobals option in your test to false. This lets PHPUnit know that you want to leave the globals (and superglobals) alone during the run.
</p>]]></description>
      <pubDate>Tue, 17 Jun 2008 08:49:19 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Using Subclasses and Accessors with Member Visibility to Protect PHP 5 Class Data]]></title>
      <guid>http://www.phpdeveloper.org/news/10343</guid>
      <link>http://www.phpdeveloper.org/news/10343</link>
      <description><![CDATA[<p>
DevShed has posted the <a href="http://www.devshed.com/c/a/PHP/Using-Subclasses-and-Accessors-with-Member-Visibility-to-Protect-PHP-5-Class-Data/">latest in their series</a> of tutorials covering the scoping keywords in PHP5 (public, private and protected). In this latest edition they work with private values from a parent class.
</p>
<blockquote>
In the last article, I explained how to work with a couple of private properties that partially comprised the API of a basic class, which is useful for saving simple strings to a specified text file.
</blockquote>
<p>
This part builds on this previous example but changes up the subclass (an instance of DataSaver) to use what they call an "accessor" - a function in the parent that returns the private variable/contstant's current value when called.
</p>]]></description>
      <pubDate>Thu, 05 Jun 2008 07:50:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stoyan Stefanov's Blog: PHP-style $GLOBALS in Javascript?]]></title>
      <guid>http://www.phpdeveloper.org/news/9780</guid>
      <link>http://www.phpdeveloper.org/news/9780</link>
      <description><![CDATA[<p>
In a <a href="http://www.phpied.com/php-style-globals-in-javascript/">new post</a> to his blog today, <i>Stoyan Stefanov</i> has a proposal to being something PHP users are very used to - superglobals - over to Javascript.
</p>
<blockquote>
Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [...] In PHP on the other hand, variables are local. [...] So how about this: adopt the $GLOBALS convention in your JavaScripts?
</blockquote>
<p>
His <a href="http://www.phpied.com/php-style-globals-in-javascript/">example</a> proposes the creation of a GLOBALS object you can assign properties to that can be used anywhere. This helps to keep the variables you truely want to be global contained, though it doesn't do much except provide a convention.
</p>]]></description>
      <pubDate>Wed, 12 Mar 2008 07:55:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Kimsal's Blog: Grails for PHP Developers Part 5]]></title>
      <guid>http://www.phpdeveloper.org/news/9663</guid>
      <link>http://www.phpdeveloper.org/news/9663</link>
      <description><![CDATA[<p>
<i>Michael Kimsal</i> <a href="http://michaelkimsal.com/blog/?p=467">points out</a> the posting of the latest part of his "Grails for PHP developers" series to his blog site - <a href="http://michaelkimsal.com/blog/?page_id=451">Part Five</a> of the series.
</p>
<blockquote>
I've put up the latest installment in my "Grails for PHP developers".  Rather than delve too much more in to Grails head on, I'm taking this installment (and at least the next one) to delve more in to the Groovy language itself.  Groovy offers similarities to PHP, but also many differences which can trip you up if you're not careful.  I'll try to lay those out as best I can in the next couple of installments.
</blockquote>
<p>
This <a href="http://michaelkimsal.com/blog/?page_id=451">new part</a> of the series goes back and puts the spotlight on GRoovy, the base of the Groovy/Grails combo. He talks about working with variables and arrays as containers for multiple pieces of data and some possible gotchas that could come up along the way.
</p>]]></description>
      <pubDate>Tue, 19 Feb 2008 12:02:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rails for PHP Developers: Three New Articles Posted (Scope, Variables & RegEx)]]></title>
      <guid>http://www.phpdeveloper.org/news/9659</guid>
      <link>http://www.phpdeveloper.org/news/9659</link>
      <description><![CDATA[<p>
<i>Mike Naberezny</i> has posted a few more articles to the "Rails for PHP Developers" website (based on <a href="http://www.pragprog.com/titles/ndphpr">this book</a>) covering some more of the basics.
</p>
<p>There's three new tutorials posted:</p>
<ul>
<li><a href="http://railsforphp.com/2008/02/18/ruby-block-scope/">Ruby Block Scope</a> - the basics of Ruby block scope, a common point of confusion for PHP developers new to Ruby. 
<li><a href="http://railsforphp.com/2008/02/13/variable-arguments/">Variable Arguments</a> - an article that shows two common API patterns found in Rails, variable arguments and option hashes, and how to implement them both in PHP. 
<li><a href="http://railsforphp.com/2008/01/17/regular-expressions-in-ruby/">Regular Expressions in Ruby</a> - a useful reference that maps all of the common PHP regular expression functions to the equivalents in Ruby. 
</ul>
<p>
Check out the <a href="http://railsforphp.com/">rest of the site</a> for even more great content.
</p>]]></description>
      <pubDate>Tue, 19 Feb 2008 08:44:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stefan Koopmanschap's Blog: Tip: use clearly readable variable names, and constants!]]></title>
      <guid>http://www.phpdeveloper.org/news/9180</guid>
      <link>http://www.phpdeveloper.org/news/9180</link>
      <description><![CDATA[<p>
<i>Stefan Koopmanschap</i> has <a href="http://www.leftontheweb.com/message/Tip_use_clearly_readable_variable_names_and_constants">a good reminder</a> for developers out there in a new post to his blog - make your code much easier to understand via readable variable names and constants.
</p>
<blockquote>
Yes, you know what code you write and you also know how it works. You can find your way around it. But what if you haven't touched a piece of code for months or even years. Or what if someone else needs to work with your code. Prevent a hell: use clearly readable variable names and constants.
</blockquote>
<p>
He points out an example of what not to do - a specific line from the FUDForum code with multiple variables named with a single letter of the alphabet in a complex if() evaluation. He suggests even using "namespacing" of sorts (PHP6 here we come!) to help compartmentalize your variables to make things even easier.
</p>]]></description>
      <pubDate>Wed, 05 Dec 2007 12:05:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[David Coallier's Blog: PHP's Strong typing (SPL_Types) and a bit of ranting about winter...]]></title>
      <guid>http://www.phpdeveloper.org/news/9121</guid>
      <link>http://www.phpdeveloper.org/news/9121</link>
      <description><![CDATA[<p>
<i>David Coallier</i> has <a href="http://blog.agoraproduction.com/index.php?/archives/56-PHPs-Strong-typing-SPL_Types-and-a-bit-of-ranting-about-winter...html">posted a nice overview</a> of what SPL Types are in PHP and a brief example of hos they can be used.
</p>
<blockquote>
I got karma to <a href="http://pecl.php.net/Spl_Types">SPL_Types</a> and added a new SplFloat() object, a few warning typos and more "flexible" strict modes for different types.
</blockquote>
<p>
SPL_Types are a way to make PHP strongly typed (no adapting variables) to help make a PHP application "more correct" by forcing the variable's type to stay the same. His example shows the creation of a few variables with these new methods and how they can be used, both correctly and incorrectly.
</p>]]></description>
      <pubDate>Tue, 27 Nov 2007 08:42:00 -0600</pubDate>
    </item>
  </channel>
</rss>
