The Beauty of Perl 6 Parameter Passing
83586
Perl 6 isn't quite out yet, but you can learn and play with it today in various incarnations. One of the most compelling new features is a revamped and revised mechanism of parameter passing. Phil Crow demonstrates how powerful it is, and how you can gradually adopt more and more powerful constructs.
740094
In his travels as a PHP developer, Jamie Wong has gathered some helpful debugging tips that are shared in this latest post to his blog.   Here are some bugfixing rules and tips Iâve learned working all these years with PHP. I emphasize mostly on fixing bugs than preventing them, which is another subject worth of its own article. Iâve moved to Rails, but I wanted to finish this post as a farewell and thanks to every article and documentation that was useful to me. Hope this is useful to you too.   Topics covered include:  Assume nothing Turn Error Reporting to show all errors Read the error message Understand the bug "Scooby-Bug, where are you?" Get as much information as possible  Each has some explanation below it and, in some places, a bit of code to clarify the point.
568782
DevShed has posted the next-to-last (part four) of their series looking at destructors in PHP5 applications today. This time they focus on passing information back out of the destructors as the script is finishing.   In this fourth article of the series I'm going to teach you how perform this process when working with multiple objects (remember that you already learned how to achieve this using only one class instance).   They start simple, showing how to handle one object to give you a base to work from. They modify this to expand it out and show the management instead of three different user data objects.
661071
PÃ¡draic Brady continues his series looking at the creation of complex views in the Zend Framework with part six today all about gathering together the thoughts and ideas from the previous articles into a cohesive whole.   Part 6 now takes our previous fragments of theory and attempts to stitch them together into a cohesive whole - a description of a possible end solution. Yes, I know code talks loudly, and we'll get there with an almighty bang in Part 7 (which I promise is no more than a week away). Until then it's more verbosity.   He suggests a list of six terms to help get everyone on the same page when talking about the complex views:   Includes Partials Dispatches Layouts Placeholders Response Segments   Since these terms would mean nothing without proper definitions, he provides a few paragraphs on each explaining what they are and, where necessary, using code to illustrate the point.
497154
Jonathan Street has a few tips for developers out there looking to speed things up on their site - seven tips towards "lightning fast sites".   I was recently creating a small tool in PHP and found myself hitting the max execution time and getting a fatal error. As it was only for my personal use I just bumped up the max execution time but it made me stop and think about how I could improve the speed of those scripts I do put up for public use. Most people aren't going to wait for 60 seconds for a page to load. Naturally I hit the internet looking for tips.    The tips he came across (each including the simple benchmarks to show the differences) were:   sizeof vs count is_int vs is_integer chop vs rtrim doubleval vs floatval fwrite vs fputs implode vs join ini_alter vs ini_set   Be sure to also check out his follow up post talking about building better benchmarks to test the sorts of tips he's given above.
155086
Unix and Unix-like systems often come with compilers and make utilities. Windows systems rarely do. Installing Perl modules on Windows can be somewhat difficult by hand. Fortunately, ActiveState's PPM utility takes away much of the pain, and it's highly customizable too. Josh Stroschein demonstrates how to install Perl modules with PPM and how to create your own repositories.
632254
Harry Fuecks has gotten busy and posted the third part of his "Joy of Regular Expressions" series over on the SitePoint PHP Blog today.   Following on from the last part, this one is more of an intermission-a round up of regex syntax seen so far and a couple of links following feedback.   He looks at two different topics:  A "must reads" section of resources for getting the most out of regular expressions A comprehensive "cheat sheet" with tips on expression delimiters, literals, pattern modifiers, character classes, quantifiers, assertions, sub-patterns, and working with the blackslash.
377236
In a new post to his blog, Sebastian Bergmann mentions a new effort he's undertaken - the porting of the Hamcrest library of matcher objects to PHP.   I have begun to port Hamcrest, which provides a library of matcher objects (also known as constraints or predicates) allowing "match" rules to be defined declaratively, to be used in other frameworks. Typical scenarios include testing frameworks, mocking libraries and UI validation rules, to PHP.   The hamcrest-php project compliments other current hamcrest-related projects and his ultimate goal is to make it available to the PHPUnit testing community (as well as with the PHPMock effort).
634435
Andrei Zmievski has posted something new to his blog today about a feature of PHP6 that's finally been hammered down - HTTP input (request) decoding.   There have been no fewer than 4 different proposals floated before, but this one combines flexibility, performance, intuitiveness, and minimal architectural changes, and has only a couple of small drawbacks. Let's take a closer look.   He details the functionality - what it is, what's been decided on, and the advantages of the method. The basic approach is a "lazy" one where PHP will only store the request when it comes in, no filtering or anything, until you want to do something with it (i.e. get it via $_GET, $_POST, etc). When the request for data is made, PHP looks at the encoding settings and formats the data accordingly.   Advantages he mentions for this method include removing the guess-work on PHP's part for which encoding the request is and that it removes some of the overhead by not processing the data until it's actually needed.
542657
In a new post today, Maggie Nelson starts with the wrong way to do something - passing an array from PHP to a database - and works backward to make it all right.   It would be really useful to have an easy way to pass arrays as bound parameters to queries or procedures from PHP. This would be especially useful if you're letting Oracle handle most of your data manipulating (as you should).   She includes an example of how she's like it to work. Sadly, it doesn't but there are some ways that a developer could get close. Here's her process:   No queries in loops, please! In the ideal world... Put all your DML in stored procedures. str2tbl The list_pkg package list_pkg in your procedure list_pkg in your PHP Leveraging list_pkg   The list_pkg is based around this article from AskTom.
575210
Popular posts from PHPDeveloper.org for the past week:PHP-Coding-Practices.com: How I Turned A Slow Array Sort Into A Quick One Using Quicksort AlgorithmZend Developer Zone: PHP Abstract Podcast Episode 4: Planning ProgrammingWeb Development Blog: Save bandwidth with PHProxy and ip2nationJob Posting: Assembleron Ltd Seeks PHP 5/MySQL/Ajax Developers (Reading, UK)PÃ¡draic Brady's Blog: Complex Views with the Zend Framework - Part 6: Setting The TerminologyThe Bakery: Four New Articles - Load Balancing, Request Info, UUID Behavior & Upload ThumbnailsCommunity News: PEAR Installer version 1.6.0 releasedChristopher Kunz's Blog: Building PHP with cURL and libmysqlclient5DevShed: Working with Prepared Queries with PDO Objects in PHP 5Secunia.com: rPath update for gd, php, php-mysql, and php-pgsql
695823
Travis Swicegood has made a new release of the successor to the PEAR RunTest package for PEAR2 - the new PHPT.    Since this is usable and PEAR2 is still being worked out, I've decided to release this as a standalone package for the time being with the intent of bundling it with Pyrus or including it directly in PEAR2 when PEAR2 is realized.   This provides the majority of the functionality provided by PEAR's pear run-tests command via its own phpt command and it can even provide pear style output.    Examples of its use are included as well as the method to download this latest version (via a PEAR channel, of course) or through the package's web page. Issues found with the software can be posted to the project's Google code page.
753153
P&aacute;draic Brady has a suggestion for all of the PHP readers out there - two articles in the latest edition of php|architect magazine, the May 2007 edition:   The two that stick in my mind are Jim Delahunt's "Unicode and PHP: A Gentle Introduction" and Jeff Moore's "Test Pattern: Model View Controller". Both are something those seeking illumination on these topics should certainly read.   The first presents an introduction to one of the hottest topics in the PHP world - Unicoding - including a few same scripts to get you going. The second article, a look at the Model/View/Controller pattern that really gets more to what the pattern is about rather than just talking about its structure.
449184
Piers Cawley has the latest from the Perl 6 mailing lists. The perl6-compiler list discusses rule engine flexibility, the Parrot people discuss the Parrot versions of Forth, Tcl, and Python as well as lexical pads, and the Perl 6 Language list argues about what being in the core really means.
493955
Tony Bibbs takes a look at an increasingly popular bit of functionality in PHP5, the SOAP extension, and notes that it still has a "ways to go".   In my latest round of web services work in PHP5 I was creating a PHP5 client that interacts with our Java-based ERP. The client needs to be a combination of a couple of WSDL's into one, nice, compact and powerful client. It should be noted this client will be distributed via the State of Iowa PEAR channel so it will undoubted by used by other project in our organization and throughout state government so the result needs to have a lot more fit-and-finish than would be typical.   He mentions his expectations for PHP's usage of the protocol, including the automatic generation of variables/methods/etc to help the developer use the remote application easier.
573906
In a new blog entry today, Matthew O'Phinney talks about updates (and refactoring) that he's done to a PEAR package he's developed, File_Fortune.   Over the past few evenings, I've refactored File_Fortune to have it implement Iterator, Countable, and ArrayAccess -- basically allowing it to act like an array for most intents and purposes. As a result, I've eliminated the need for the File_Fortune_Writer package, and greatly simplified the usage.   The package is designed to make an interface between the casual PHP user and the fortune files common on most *nix machines. To illustrate he update, he includes some code that grabs the fortune file, parses it to grab a random one and echoes them out. Also included is the save() method so you can add your own to the list easily.
572982
In a new post to his blog today, Matthew O'Phinney dives in to some of the more advanced features that the Zend_Form component of the Zend Framework has to offer.   I've been working on  for the past few weeks, and it's nearing release readiness. There are a number of features that Cal didn't cover in his DevZone coverage (in part because some of them weren't yet complete) that I'd like to showcase.   These additional features include internationalization, element grouping and array support. He looks at each of these, including some sample code where needed, and shows you how they can be useful to you and your ZF application.