News Feed
Sections

News Archive


Community Events






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


feed this:

Eran Gelperin's Blog:
Operator overloading in PHP
0 comments :: posted Tuesday July 08, 2008 @ 10:29:54
voice your opinion now!

Eran Gelperin gives an overview of the current state of overloading abilities PHP has in a new blog post today:

Operator overloading is a programming language features that allows operators to act differently depending on the type of data they are operating on. Since OOP lets us create custom types (classes), there are plenty of opportunities to do useful and interesting code manipulations using operator overloading.

He talks about magic functions, the additions that the SPL made, the PECL addition operator and how much its currently being discussed on the PHP internals list.

tagged with: operator overload spl magic function operator internals mailing list


Etienne Kneuss' Blog:
SplFastArray to speed up your PHP arrays
0 comments :: posted Monday June 09, 2008 @ 12:54:04
voice your opinion now!

Etienne Kneuss has posted about a new part of the Standard PHP Library that creates arrays that are up to thirty percent faster than normal methods - SplFastArray.

Antony got the idea to implement a C-like array wrapper in SPL: SplFastArray. The main advantage of that class is performance, it's indeed faster than PHP arrays. How so? No free lunch: The speedup comes from the fact that non-numeric indexes are not allowed and that the array is of fixed size.

The code sample shows the setting of the size for the array (and changing it) with a var_dump of the output result. This method is always faster than normal arrays, it just varies how much from system to system (anywhere from ten to thirty percent).

tagged with: spl splfastarray set size speed faster

Rob Allen's Blog:
Simple Zend_Form File Upload Example Revisited
0 comments :: posted Monday May 19, 2008 @ 09:33:13
voice your opinion now!

Rob Allen has revisited a Zend_Form example he had created before, updating it with a fix for a common error people were seeing when the form tries to validate.

I've been thinking about the Simple Zend_Form File Upload Example that I discussed last month. To recap, if you haven't read the comments, if the form fails to validate for some reason then you get a nasty error.

He corrects the issue by creating an ArrayObject (thanks to the SPL) that can be used both as an array and can look like a string to htmlspecialchars and changing up the validation a little bit to work with the new object.

tagged with: zendform zendframework upload form example spl arrayobject

Etienne Kneuss' Blog:
SPL Datastructures updated
0 comments :: posted Tuesday May 13, 2008 @ 09:31:24
voice your opinion now!

Etienne Kneuss has posted about some updates to the data structures functionality in the Standard PHP Library (SPL), specifically some new additions.

There finally is documentation for SplDoublyLinkedList, SplStack and SplQueue and some "new" classes: SplHeap (abstract), SplMaxHeap, SplMinHeap and SplPriorityQueue, documentation of those classes is in progress.

An example of the new functionality (for SplPriorityQueue) is included in the post showing the insertion of a value into a pre-existing array (without having to slice or splice!).

tagged with: spl standardphplibrary datastructure heap priorityqueue

Developer Tutorials Blog:
Iterating PHP objects, and readable code too!
0 comments :: posted Tuesday May 06, 2008 @ 14:34:58
voice your opinion now!

The Developer Tutorials blog has a recent post that talks about manipulating objects in PHP with the help of the iterators that the Standard PHP Library has to offer.

It's a generally accepted fact that more readable code is more maintainable and easier for other developers to pick up. [...] Today I'm going to take a look at object iteration, most commonly found in the Standard PHP Library, and explore using the Iterator interface to simplify looping.

The main part of the tutorial shows how to implement the Iterator interface of the SPL to create your own custom methods, theirs being a Database version with methodsfor rewinding, reading and getting the current record you're working with.

tagged with: spl iterator tutorial database implement

Marco Tabini's Blog:
5 PHP 5 features you can't afford to ignore
0 comments :: posted Tuesday April 29, 2008 @ 17:06:45
voice your opinion now!

Marco Tabini has posted his list of what he considers five features of PHP5 that you "can't afford to ignore" when doing your development work:

Despite the fact that you may not have a choice in the matter, upgrading comes with a number of bonus new features that can help you write better code and gain access to new functionality that required a fair amount of hacking in previous version. Here's a quick list of 5 personal favourites.

The feature to make his list are SimpleXML, JSON/SOAP, PDO, the Standard PHP Library and SQLite. Each has their own bonus feature(s) included too for a little extra incentive to check them out.

tagged with: php5 feature list ignore simplexml json soap pdo spl sqlite

Make Me Pulse Blog:
PHP6, Unicode and TextIterator features
0 comments :: posted Friday March 14, 2008 @ 09:32:34
voice your opinion now!

On the Make Me Pulse blog, there's a look at PHP6's support of Unicode in the SPL (Standard PHP Library) TextIterator handler.

I've just install the last version of PHP6 dev and I've decided to test the famous new feature, the PHP Unicode Support. I will not explain new things about PHP6 or Unicode or TextIterator, it's just my discoveries test on this features.

He steps through the process he followed - enabling Unicode support, testing various output methods (including just an echo and using the TextIterator) as well as some of the manipulation methods (next/first/current) that can be used to get certain characters out of a string.

tagged with: php6 unicode textiterator spl standard php library enable

phpRiot.com:
Using the PHP 5 Iterator interface with Smarty
0 comments :: posted Monday March 10, 2008 @ 09:35:00
voice your opinion now!

On the phpRiot blog, Quentin Zervaas has posted a quick tutorial about using the Iterator interface (part of the Standard PHP Library) together with Smarty to loop through some objects:

The PHP 5 Iterator interface is very useful for defining custom behaviour for looping over objects, however I just noticed that looping over such objects in Smarty will not work correctly. Smarty will in fact cast an object back to an array.

He includes code examples of his problem to illustrate and shows how he got around the problem - a getData() function he defined that just returns the array from the object.

tagged with: iterator interface smarty php5 spl object array

Make Me Pulse Blog:
Tips RecursiveArrayIterator on mulitdimensional Array
0 comments :: posted Monday February 11, 2008 @ 13:07:00
voice your opinion now!

On the Make Me Pulse blog, Antoine Ughetto shares a method he came up with to recurse through an array using the SPL method - the RecursiveArrayIterator method.

When we have a multidimensional array we have to make some recursives function to parse it. A simple way to get the keys and the value of this type of array is to use the SPL library of PHP.

A code example is included, parsing through a recursive array to output each of the key/value pairs it contains (and using only about five or six lines of code to do it).

tagged with: spl library standard recursiveiteratoriterator multidimensional array

Dan Scott's Blog:
Oooh...looks like I've got (even more) work cut out for me
0 comments :: posted Friday January 18, 2008 @ 13:58:00
voice your opinion now!

On his blog, Dan Scott notes that the PHP language will be getting a native doubly-linked list structure in the coming days (as mentioned by Etienne Kneuss).

This is fabulous news; when I wrote the File_MARC PEAR package, I ended up having to implement a linked list class in PEAR to support it.

Doubly linked lists are normal lists, but the elements also have links to both the previous and next items in the list as well. Two other structures will be added right along with it - SplStack and SplQueue.

tagged with: doublylinked list dtructure spl addition splqueue splstack


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

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