Dynamically Typed: More on PHP 5 Standard Library
675056
Over on Dynamically Typed today, there's a new posting continuing Harry's discussion of the PHP 5 Standard Library (and how Marcus Boerger thinks it could be corrected).
644868
The International PHP Magazine has conducted a poll on its website over the past week, this time asking "You Did Not Know That...", asking developers which of the true statements about PHP they didn't know about.   The options this time were:  The trailing '?>' in PHP is Optional You can embed other programming languages in PHP Objects can be made to look like arrays by using Standard PHP Library require is faster than require_once Anything Less than 5.1.0 is Silly All  There wasn't a whole lot of difference in the results of this poll, but the most all-inclusive of the list was the one selected the most - "All". Following that, was that the trailing closing PHP tag is optional, then a tie for third between the "embed other languages" and "Less than PHP 5.1.0" options.   Be sure to cast your vote in their latest poll that asks readers that they're really looking for in their frameworks.
126013
On Dynamically Typed today, there's a new posting concerning the PHP Atom Server.
409871
In a new post, Christopher Jones talks about some difficulty a friend of his was having with returning a connection type from Oracle back to a script. In his case, it was a Ruby script and, unfortunately, there's no direct support for it. So, Christopher jumped in to help out.    PHP's oci8 extension oci_bind_array_by_name() can bind collections but there is no equivalent in ruby-oci8.    Justin outlines a solution on his blog Ruby: Invoking a PL/SQL Package with Array args. His example relies on some company infrastructure so I came up with this standalone example.  This first SQL*Plus script sets up the scenario.     Stick with me on this one - there's some PHP right there at the end. He shows how much simpler the same kind of operation would be in PHP thanks to the oci_bind_array_by_name functionality understanding the return value. What took about 20 lines for just the Ruby code to handle the result correctly takes only five in PHP.
22384
Spurred on by a recent post to the php-dev mailing list by Dmitry Stogov the ever-popular "namespaces discussion" has surged back to the top of everyone's list. Dmitry proposed a patch for PHP6 that would easily implement namespaces for the upcoming version.   All class and function names inside are automatically prefixed with namespace name. Inside namespace, local name always takes precedence over global name. It is possible to use the same namespace in several PHP files. The namespace declaration statement must be the very first statement in file.   The general idea is to provide an easy separation of functionality but to keep things accessible at any level (in scope, in parent scope, etc). He's included code in his mailing list post to illustrate how it would all work.   Several others in the PHP community have jumped on and are already talking about this new proposal:   Evert Pot's post a blog entry from Richard Heyes proposing a namespace character a new post from the PHP 10.0 Blog on simplicity in namespaces this new post from Tony Bibbs some thoughts from Tobias Schlitt happily supporting the proposal this post from DynamicWebPages.de
334117
Sean Coates has posted a new article today about one of the features that will be included in the next major release of PHP (5.3) - late static bindings.   Late Static Binding (LSB) is a topic that's been brought up numerous times in the past three years in various PHP development discussion circles (and we're finally getting it in PHP 5.3)Ã¢Â"but what does it really do, and why should you care? Here's a simple practical example of how it can greatly simplify your code's design.   He shows its usefulness in an example of how it works, letting classes/objects access static methods, constants and properties of inherited classes (besides their own). His example (using beer, of course) shows how an extended class (Ale) can reference the constant (NAME) in the parent class (Beer). Thanks to a new keyword in PHP 5.3 - "static::" - helps define the difference even clearer.   Check out the rest of the article for a more practical usage too.
625065
On DevShed a new series has started (a six-part one) with This new tutorial posted today talking about the use of the Yahoo! web services in a PHP5 application.   It's not my intention to provide you here with a fully-featured guide on how to use Yahoo!'s Web services with PHP 5, because the best place to go is simply the aforementioned Developer Network. Instead, I'll offer to you a bunch of code samples that hopefully will assist you in the development of PHP 5 applications that will utilize some of these useful web services.   You'll need to get an Application ID to work with before you get started (go here to sign up, you'll also need a Yahoo! ID), but the rest of the code is provided. They make a search request to the Yahoo! backend for "madonna" and show the XML formatting of the results.   They also include examples of querying two other services offered by the company's backend API - video search and an image search.
245642
Adding to his popular Install PHP 5 on Windows workshop, Edward Tanguay has just posted two new steps, which teach you PHP 5 object-oriented programming in a very practical manner: In the first step you download and set up a PHP 5 page which reads an XML file and displays book reviews linked to the Amazon Associate program. In the next step, Edward goes line-by-line through the code and examines the classes, properties, constructors, public methods, private methods and static methods discussing how each works and why programming in this fashion is better than procedural programming. There are dozens of screen screenshots which make this tutorial easy to follow. If you get stuck or want to discuss an issue, you can instantly post questions and comments on each step without registering.
229627
New from Dynamically Typed today, there's a new posting about a new(ish) site out there that's been turning a few heads in the PHP community - The PHP FTW.
79883
DevShed has posted the last part of their latest series, a look at using the Prototype pattern in a PHP5 application, Building a Data Validation System with the Prototype Pattern with PHP 5.   Taking into account that this pattern can be helpful in situations where a prototype object is required, along with other clones of it, in this final installment of the series I'm going to demonstrate how to use it to build a simple application for checking the validity of incoming data.   They create a simple validation system with the pattern to check and see if the inputted data is either alpha only or alpha-numeric. On top of this, they create some additional classes to check the data for things like being a valid email address or if the value is made up of all numbers.
79987
DevShed continues their looks at autoloading classes in PHP5 today with this new tutorial focusing on catching and handling any errors that might be thrown in the process.   This is the third article in the series on how to auto load classes in PHP 5. This article will demonstrate how to trigger exceptions in a way that can be caught by the corresponding "catch()" block.  [...] Nonetheless, this issue can be fixed with relative ease. That will be the goal of this third article of the series. So if you're interested in learning how this solution will be implemented, don't waste any more time and start reading now!   They start by looking at throwing an exception with the __autoload so that the script can catch it. The go back to mention the method they'd talked about before - using just eval() - and then show the "new and improved" method of handling the result with a try/catch block instead of a direct output.
383038
In his new post on PHPEverywhere today, John Lim shares some of the experiences he's had so far in making the move up from PHP 4 to PHP 5 in his applications.   The transition was relatively painless. [...] What's nice about PHP5 is that it caught some errors that have been lingering in our code: PHP5 no longer allows a function to be defined twice, and some basic variable referencing errors that we missed previously.   They made the move to PHP5 for the latest versions of their applications, but have still stuck with the legacy, PHP4 versions for the time being to give customers a buffer period to make the move themselves. He also mentions changes to the way they make Ajax calls. John is a lead developer for both the ADOdb and PHPLens projects.
421737
On Dynamically Typed today, Harry discusses a possible trend seen in some of the PHP jobs out there:
152445
Latest PHPClasses.org Releases:Flash MessagesRSS and Atom Feeds Processing APImabp::tagCloudUltimate MySQLerror_managerSingly Linked ListChinese Encode ConvertphpSortableASCII Art GeneratorPSPLMultiselectNiftyCubeAmazon ECS Webservicesimple Email ClassPHPDance
460464
A new posting from Dynamically Typed - More on rich web UIs - has a few interesting links to share, as well as Harry's search for a XmlHttpRequest method.
464596
PHP isn't exclusively for Web pages. You can use it like Perl for cron jobs and other tasks.
298536
http://www.phpdeveloper.org/form/view/type/addnews PHPDeveloper.org: PHP News, Views, and Community In a new post Paul Jones points out some of the new behaviors that the extension is showing in the latest of the PHP 5 seres (version 5.2).   He starts with a code example that would work with a previous version of PHP/PDO that would allow for the binding of a single value to multiple places in the SQL statement. But:   Sadly, this is no longer the case in PHP 5.2.1. For valid reasons of security and stability in memory handling, as noted to me by Wez Furlong, the above behavior is no longer supported. That is, you cannot bind a single parameter or value to multiple identical placeholders in a statement. If you try it, PDO will throw an exception or raise an error, and will not execute the query. In short, you now need to match exactly the number of bound parameters or values with the number of placeholders.   Unfortunately, this is used quite often in Paul's Solar framework, so an update to the Solar_Sql_Adapter::query() method has had to been made to allow for the binding of multiple items automatically. It works by incrementing the bind location (like ":foo") with numbers at the end - simple and effective - and you can still pass an array to it and have it automagically work.