Another reason to switch to PHP 5.0 from PHP 4.0: iterators

One for the "missing foreign combatants" department | Main | Poor mickey mooreoon....... ยป
Posted: July 27, 2004
O'Reilly's ONLamp.com has this cool example:

PHP 4.X:

$dir = opendir($path);
while (false !== ($file = readdir($dir))) {
print "$file\n";
}
closedir($dir);


PHP 5.0

foreach (new DirectoryIterator($path) as $file) {
print "$file\n";
}

The PHP team is really trying to go for Microsoft's ASP.NET now. According to the article, the PHP team has added iterators for XML and database access as well. The database part is particularly exciting because it allows for cleaner, more object-oriented access to databases.

The rest of the article is a good explanation of the major differences between PHP 4.X and 5.0. Anyone needing help getting PHP 5.0 built on their hosting service should check out my brief explanation of how to compile it as a CGI executable and override your hosting service's built in version. Granted, those instructors are based in part on my hosting service, dreamhost.com's, service options.

Freedom from being criticized is not "democratic"
Why Ted Turner hates big media
Juxtaposing apples and oranges rarely produces good results...
What is war in the modern world?
Gates calls for more software research
Wisconsin Police go Gestapo on local residents
Blogrolling software beta by friday---hopefully
Kio Venis Antau

August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003

Kategorioj

(In)famous Quotes - (3)
Alliance Posts - (4)
Announcements - (8)
Civil Liberties - (11)
Code Tips and Tutorials - (10)
Coding Information and Ideas - (26)
Column Clarifications - (1)
Columns - (6)
Cool Pictures - (1)
Culture - (37)
Documentation - (2)
Drug War Atrocity Archive - (3)
Economy - (3)
General Computing - (17)
Humorous Things - (8)
Intellectual Property Issues - (13)
Men's Interest - (7)
Misc - (27)
Misc Politics - (76)
Music - (5)
Pure, Unadulterated Stupidity - (8)
Race Stupidity - (4)
Religion - (25)
Republished Commentary - (1)
Satire - (1)
Social Commentary - (6)
Terrorism, Genocide and Related Uncool Things - (11)

Recent Posts

April 23

Reach Your Audience despite Video Marketing Noise

The internet has allowed the third wave of programming to begin in the form of video streaming. It offers the best of both worlds in that now everyone can find exactly what they want, and only what they want, 24 hours a day from anywhere. It’s pretty much the perfect storm made possible by the commercialization of the internet. Throw mobile phones, tablets, media systems, and other crazy devices and you have a Star Trek level of consumption technology.

 

YouTube dominates this third wave although even now niche video services are beginning to break off and create value for its more specific viewers. Blip offers web series for example.

April 25

The LG G4 is Here

Three years of research by LG is what led to the use of a leather back that is also treated making it water resistant, scratch resistant, and very difficult to puncture. The leather comes in a brown finish as well as beige, sky blue, and a black version coming very soon. Other colors are planned for the future. You can get the phone without the leather back as well with options like white plastic in a ceramic pattern or a black finish with a hammered pattern.

 

Interestingly all LG G4 phone backs are interchangeable so mix and match if you end up not liking what you have.

April 28

Jukely Raises $8 Million to Expand

Jukely launched in 2013 out of the then new TechStars NYC business accelerator program as an online service designed to help match music with the consumers that love it. It would also match music lovers with each other helping those that were into lesser known unique bands to ability to create online groups that could attend concerts together. Last year Jukely offered its Unlimited program giving users the opportunity to go to an unlimited number of concerts put on by lesser known bands for just $25 per month.


This new service took off big time in New York City so Jukely abnnouced that it would be expanding into an additional 10 U.S cities including Los Angeles, Miami, Seattle, Denver, Philadelphia, Austin, San Francisco, and more.

Spotlight

Star Wars Holograms are Coming

3D Gets a Makeover

If you haven’t heard of graphene you will very soon. Right now in fact! This material can make it poissible to create photo realistic 3d images on smartphones and mobile devices. Up to this point viewers would need to be subjected to ridiculous 3d glasses or “parallax barriers” that are less 3d and more headache inducing silliness.

A new system using graphene and laser physics can create pop-up displays without glasses.