News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Dikini.net:
Some ways to use saved state with closures in PHP
January 25, 2006 @ 12:43:20

On dikini.net today, there's a new post that talks about a method of implementing saved state in PHP, and how to couple it with closures.

In a previous short post I describe a way to emulate closures in php. Using that technique execution environment, otherwise known as a call stack can be saved for future use. This can be put to good use. A couple of patterns or programming techniques could be useful in practice.

A closure represents a state => implemenation of a state pattern. This is a bit rich. Usually in OO programming the state pattern is implemented by encapsulating different protocols, for denoted states. This is simple to implement by substituting your protocol specification with a different name.

His example starts off with the Drupal hooks, using the State pattern to create a method of tracking "where we are" via PHP.

0 comments voice your opinion now!
saved state closures emulation call stack saved state closures emulation call stack


blog comments powered by Disqus

Similar Posts

Dikini.net: Some ways to use saved state with closures in PHP

SitePoint PHP Blog: The state of functional programming in PHP

John Coggeshall's Blog: Alan has smoked too much PHP

DevShed: Using Advanced Functions to Maintain the State of Applications with PHP Sessions

Sandro Groganz\'s Blog: Submit your Proposals for eZ publish Conference


Community Events





Don't see your event here?
Let us know!


developer application install interview wordpress language introduction list series podcast threedevsandamaybe library community bugfix laravel framework code api configure release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework