News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

PHP in Action Blog:
I want enums in PHP
0 comments :: posted Monday May 12, 2008 @ 08:41:16
voice your opinion now!
I want Enums in PHP

That's how this new post on the PHP in Action blog starts this morning. The one thing that he wants is enumeration support in PHP. He shows how it can currently come close with a "roles" system:

Useful examples I've encountered in web programming are states or stages in a process and user roles. Another kind of example is one I used in PHP In Action: an authorization system with three fixed roles or categories of user: regular, webmaster and administrator.

He sets up an example class that sets constants for the different access levels rather than just relying on strings to handle it (which, as he points out, could very easily be misspelled and not throw any kind of error) .

tagged with: enumeraction enum phpinaction multiple value constant


Hasin Hayder's Blog:
Unexpected return value from Facebook FQL.query via PHP REST Lib
0 comments :: posted Monday February 18, 2008 @ 12:06:00
voice your opinion now!

Hasin Hayder had been working with the Facebook API and stumbled across a bug in an application they had created for the social networking site:

The method which we used to count number of friends of a specific user who has added that application was returning 1 when there is no friend actually installed it.

He gives the SQL query and the PHP code he was originally using to find out the number of users for the application. The problem came from the fact that the returning value wasn't an array - it was a string. The corrected code (that checks for array-ness) is also included.

tagged with: facebook query rest library return value array string


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

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