News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
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!
php saved state closures emulation call stack php saved state closures emulation call stack



Similar Posts

Mike Naberezny's Blog: __get() - an alternative to __autoload()

SitePoint PHP Blog: Living Dangerously with PHP and UTF-8

PHPit.net: Ajax & PHP without using the XmlHttpRequest Object

Ernies Blog: Switching Between Multiple php Versions Using Apache on Windows

Mike Naberezny\'s Blog: pecl/operator and Other Neat Stuff


Community Events









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


ajax PHP5 example code cakephp zendframework releases security package job developer release book framework conference application zend database PEAR mysql

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