<?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, 23 May 2013 10:04:50 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Web & PHP Magazine: Issue #12 - Don't Get in a PECL]]></title>
      <guid>http://www.phpdeveloper.org/news/19290</guid>
      <link>http://www.phpdeveloper.org/news/19290</link>
      <description><![CDATA[<p>
The latest issue of the Web and PHP Magazine has been published - <a href="http://webandphp.com/issue-12">issue #12</a>, "Don't get in a PECL". This latest issue includes articles like:
</p>
<ul>
<li>"The Power of PECL" by <i>Simon Holywell</i>
<li>"Be 'ready' if you want to be done!" by <i>Steffan Surdek</i>
<li>"All Data is Relational" by <i>Cory Isaacson</i>
<lI>"Fixing PHP Production Problems with APM" by <i>Dan Delany</i> and <i>Chris Kelly</i>
<li>"Trust" by <i>Sebastian Bergmann</i>
</ul>
<p>
You can download your copy for free from <a href="http://webandphp.com/issue-12">their site</a> and catch up on back issues.
</p>]]></description>
      <pubDate>Fri, 08 Mar 2013 10:23:36 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ryan Gantt's Blog: Anonymous recursion in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16705</guid>
      <link>http://www.phpdeveloper.org/news/16705</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Ryan Gantt</i> looks at an interesting way to get around a limitation in PHP dealing with <a href="http://zuttonet.com/articles/anonymous-recursion-php/">anonymous recursion and closures</a> that throws a Fatal error when called.
</p>
<blockquote>
Turns out that variables called as functions must be an instance of Closure, an instance of a class which implements __invoke(), or a string representing a named function in the global namespace. In the anonymous function body above, $fibonacci is none of these. It is an undeclared, free variable in the closure created by the anonymous function. At the time when it's called, it hasn't been bound-hence the Notice that you would have gotten if error reporting were set at a high enough threshold - and therefore can't be called as anything, let alone as a function.
</blockquote>
<p>
He tried using the "use" functionality PHP closures have to bring a variable/object/etc into the scope of the running function, but it still threw an error. As it turns out, the combination of "use"-ing the object and calling it by reference handles things correctly. He takes this method and applies it in two examples - one call in an <a href="http://php.net/array_map">array_map</a> function and another in an <a href="http://php.net/array_reduce">array_reduce</a>.
</p>]]></description>
      <pubDate>Thu, 11 Aug 2011 10:55:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrea Giammarchi's Blog: PHP Serialization And Recursion Demystified]]></title>
      <guid>http://www.phpdeveloper.org/news/13195</guid>
      <link>http://www.phpdeveloper.org/news/13195</link>
      <description><![CDATA[<p>
<i>Andrea Giammarchi</i> has <a href="http://webreflection.blogspot.com/2009/09/php-serialization-and-recursion.html">posted a new item</a> to his blog looking at freezing and unfreezing objects and variables in PHP apps. Specifically he points out a few gotchas to watch out for.
</p>
<blockquote>
PHP has different in-core callbacks able to help us with daily deployment, debug, improvements. At the same time, PHP is loads of intrinsic "gotcha", too often hard to understand, hard to explain, or simply hard to manage. One common problem is about debug, caching, or freezing, and the way we would like to debug, cache, or freeze, variables.
</blockquote>
<p>
He presents the problem - serializing variable information to "freeze" it and how recursion can cause problems down the line. He looks at the two different kinds of recursion (recursion and recursion by reference) and, after looking at a few possible solutions to fix things, eventually comes down to a way to remove the recursion "without losing it".
</p>]]></description>
      <pubDate>Wed, 09 Sep 2009 15:39:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: PHP's segmentation faults GDB-fu]]></title>
      <guid>http://www.phpdeveloper.org/news/11167</guid>
      <link>http://www.phpdeveloper.org/news/11167</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has <a href="http://derickrethans.nl/phps_segmentation_faults_gdbfu.php">shared a quick tip</a> for locating a code crashing kind of problem with your application when something like XDebug isn't around.
</p>
<blockquote>
However, because we as PHP developers are lazy, provide a few GDB tricks to make this easier. First of all, it's only really going to work if you haven't stripped the symbols from your PHP and Apache binaries. Secondly, you still need to have the PHP source lying around somewhere.
</blockquote>
<p>
He suggests using GDB to run the backtraces and create a file to help you track down the infinite recursion problem that could be giving you issues. 
</p>]]></description>
      <pubDate>Wed, 08 Oct 2008 09:32:09 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Debuggable Blog: XPath on PHP Arrays (Set::extract)]]></title>
      <guid>http://www.phpdeveloper.org/news/11096</guid>
      <link>http://www.phpdeveloper.org/news/11096</link>
      <description><![CDATA[<p>
On the Debuggable blog there's <a href="http://debuggable.com/posts/xpath-on-php-arrays-set-extract:48ca6265-258c-4032-b3ff-55b84834cda3">an interesting post</a> where <i>Felix</i> talks a bit about something I've seen requested quite a bit - a method for locating information in an array. His answer is an XPath-style query system to root out your custom information.
</p>
<blockquote>
One of the requirements [of the original Set::extract method] was that the new method would need to be faster or at least as fast as the old implementation. My first attempts were big failures. Not only did the solutions I came up with contain tons of bugs. No, they were are also a lot slower the old extract function. A few benchmarks later and I discovered the biggest bottleneck in my implementation: Recursiveness.
</blockquote>
<p>
He notes that no doing things recursively (not just in this situation, but ever) can help with a speed boost. In his example, a small change made all the differences and the <a href="https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/set.php#L334">XPath implementation</a> in the CakePHP core makes grabbing information from any array simple.
</p>
<blockquote>
While the implementation does not support full XPath (and probably won't in future), feel free to make suggestions on additional selectors or the idea in general.
</blockquote>]]></description>
      <pubDate>Fri, 26 Sep 2008 10:25:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: Displaying N-Deep Trees (Remember Your Algorithms Course?)]]></title>
      <guid>http://www.phpdeveloper.org/news/10784</guid>
      <link>http://www.phpdeveloper.org/news/10784</link>
      <description><![CDATA[<p>
On his Tower of Power blog <i>Daniel Cousineau</i> has <a href="http://www.toosweettobesour.com/2008/08/05/displaying-n-deep-trees-remember-your-algorithms-course/">written up a look</a> at using a more detailed categorization method than just a parent/child relationship on your data - <a href="http://en.wikipedia.org/wiki/Tree_traversal">Tree Traversals</a>.
</p>
<blockquote>
If the software calls for only 2 levels of categorization (Parent and Child only), a simple nested for loop will suffice. However, software requirements change and you'll soon find yourself up shit creek without a paddle if you need to support 3 or 4 levels of nesting. [...] To those who's training is less formal (most web developers I meet have practical training, not formal), I'll help you out: <a href="http://en.wikipedia.org/wiki/Tree_traversal">Tree Traversals</a> (or if you are completely lost, <a href="http://en.wikipedia.org/wiki/Recursion">Recursion</a>).
</blockquote>
<p>
He creates a recursive function that, when passed in a category set with different types in it, can handle each of them and then calls itself again with the new child data. His sample code creates url out of a set of categories.
</p>]]></description>
      <pubDate>Thu, 07 Aug 2008 12:03:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Developing a Discussion Forum in PHP with Recursion (Part 3)]]></title>
      <guid>http://www.phpdeveloper.org/news/5371</guid>
      <link>http://www.phpdeveloper.org/news/5371</link>
      <description><![CDATA[<p>
On DevShed today, they've posted <a href="http://www.devshed.com/c/a/PHP/Developing-a-Discussion-Forum-in-PHP-with-Recursion/">this new tutorial</a> continuing their "recursion in PHP" series - "Developing a Discussion Forum in PHP with Recursion".
</p>
<quote>
<i>
After covering in detail how to define recursive method and functions, the question is: what comes next? Luckily, there's vast terrain to explore with reference to using recursion in PHP. As I said in previous articles of this series, recursion can be used in cases where a specific tree structure or a linked list needs to be navigated, in order to display, add, delete or edit its values. It's exactly for that reason that this last article will be focused on building an extensible discussion forum, which precisely uses a tree structure (implemented on a single MySQL database table) for displaying forum messages and adding new posts.
</i>
</quote>
<p>
Using what they've taught in the first <a href="http://www.phpdeveloper.org/news/5285">two</a> <a href="http://www.phpdeveloper.org/news/5336">parts</a> of the series, they put it to good use, giving you a step-by-step guide to a simple recursive forum. They start with the database structure (always a good thing) and work out from there, creating the "ThreadProcessor" class and fetch functionality to grab the thread's contents. They also include a bit of functionality to create threads as well. It's not much more than that, so don't expect too much, but it is a great place to start.
</p>]]></description>
      <pubDate>Mon, 15 May 2006 11:44:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: 2 Beginners Guides I Wish I had when I Started with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/5338</guid>
      <link>http://www.phpdeveloper.org/news/5338</link>
      <description><![CDATA[<p>
From <i>Cal Evans</i> over on the Zend Developer Zone today comes <a href="http://devzone.zend.com/node/view/id/237">two links</a> for beginner guides the "wished he'd had when he was starting PHP".
</p>
<quote>
<i>
<p>
Everybody starts somewhere. I started (officially) with my Commodore 64. I wrote my first commercial program on it and it started a life-long obsession with programming. Being a self-taught programmer, there are gaps in my education. The 2 biggest areas I have trouble with are Recursion and Graphics. Thank (generic deity reference) for the Web. 
</p>
<p>
While surfing around today, I stumbled upon 2 tutorials covering those two areas. They are well written, informative and free so I thought I'd share them with you on the off-chance you struggle with them as well.
</p>
</i>
</quote>
<p>
The two <a href="http://devzone.zend.com/node/view/id/237">he shares</a> are <a href="http://www.devshed.com/c/a/PHP/Fundamentals-of-Recursion-in-PHP/">this guide to recusion</a> from DevShed and a guide from Builder.com on the <a href="http://builder.com.com/5100-6371-5092227.html">creation of graphics</a> on the fly.
</p>]]></description>
      <pubDate>Tue, 09 May 2006 06:45:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Using Recursive Methods in Object-based PHP Applications (Part 2)]]></title>
      <guid>http://www.phpdeveloper.org/news/5336</guid>
      <link>http://www.phpdeveloper.org/news/5336</link>
      <description><![CDATA[<p>
DevShed has posted <a href="http://www.devshed.com/c/a/PHP/Using-Recursive-Methods-in-Objectbased-PHP-Applications/">part two</a> of their series dealing with recusion in PHP, this time with a focus on its use in a more object-oriented environment.
</p>
<quote>
<i>
<p>
Welcome to the second tutorial of the series "Recursion in PHP." Comprised of three parts, this series introduces the fundamentals of recursion in PHP, including the definition and use of recursive functions in procedural PHP scripts, as well as the creation of recursive methods in object-oriented Web applications.
</p>
<p>
Now, in this second part of the series, I'll explore some advanced uses of recursion in PHP, particularly in the terrain of object-oriented programming. I will develop a couple of object-based applications which use recursive methods for accomplishing their tasks. By the end of this tutorial, you should have a pretty solid grounding in how to define recursive methods within your own PHP classes.
</p>
</i>
</quote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Using-Recursive-Methods-in-Objectbased-PHP-Applications/">start</a> with a simple example of OOP with recursion, handling some "HTML widgets" to be output to a page (div, h1, p, and ul tags). With this library created and in place, they work up a "generator" class to actually build the page dynamically. Finally, they bring it all together with the creation of a simple template processor for simple page creation.
</p>]]></description>
      <pubDate>Tue, 09 May 2006 06:25:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Fundamentals of Recursion in PHP (Part 1)]]></title>
      <guid>http://www.phpdeveloper.org/news/5285</guid>
      <link>http://www.phpdeveloper.org/news/5285</link>
      <description><![CDATA[<p>
DevShed has posted their latest tutorial today, a look at some of the <a href="http://www.devshed.com/c/a/PHP/Fundamentals-of-Recursion-in-PHP/">basics of recursion</a> and working with it in PHP.
</p>
<quote>
<i>
<p>
Iteration is a straightforward concept. Recursion is a bit more complicated; it can be defined as a regular function that calls itself. PHP supports recursive functions. This article, the first of three parts, will explain recursive functions and help you see why they are useful.
</p>
<p>
Considering the important role that recursion plays in most programming languages, and specifically in PHP, over this series I'll be demonstrating how to define and use recursive functions with numerous code samples, thus you can learn quickly how to include them in your own PHP scripts.
</p>
</i>
</quote>
<p>
If you've never used recursion, you're in luck - they <a href="http://www.devshed.com/c/a/PHP/Fundamentals-of-Recursion-in-PHP/">start from the very beginning</a>, explaining it with a simple example of pushing the entire contents of an array (with subarrays) out to a file. They use this exmaple as a base to improve the function, adding the function to write the data out. They finish it off with two handy recursive functions for everyday use - one to escape the entire contents of an array and one that does the same, but checks to see if magic quotes is on.
</p>]]></description>
      <pubDate>Tue, 02 May 2006 07:31:46 -0500</pubDate>
    </item>
  </channel>
</rss>
