SitePoint PHP Blog: The Joy of Regular Expressions [3]
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.
732440
The International PHP Magazine has posted results from their latest PHP community poll as voted on by visitors to their site. The question for this poll asked developers what they thought, of the choices on the list, was the most common mistake that PHP developers make.   Coming in at number one by an overwhelming lead was "Not escaping entities and SQL input" (a definite problem indeed) with the next highest option, "Not using a Framework" a full twenty percent lower. The next two options were closer (descending) - "Using old PHP versions" and "No or little use of Object Orientation".   There's a new poll this week for your consideration - this time asking which stage, of the five options, should come first in the development cycle of a typical content management system. Head on over and cast your vote today!
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.
291476
Matthew Turland, like many in the PHP community these days, has been pondering PHP6 and what it might mean to both the developers and to the language itself:   Be that as it may, as a user with about five years under his belt as of now who has seen all qualities of PHP code ranging from pristine to pedantic, a thought or two has crossed my mind on the subject of the latest upcoming incarnation of the language.   Specifically, he talks about some of the hot topics like namespaces, the mysqlnd driver, Unicode support, and named parameters. Overall, though, his comments are positive, looking toward a brighter future for PHP with this upcoming edition.
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.
722744
On his blog, Ian Bicking has posted some of his thoughts on a positive look at PHP - what he thinks PHP has done right.   With the recent talk on the blogosphere about deployment (and for Django, and lots of other posts too), people are thinking about PHP a bit more analytically. I think people mostly get it wrong.   He points out that PHP, in essence, is a CGI-style execution and, in being so, makes it more flexible. Both sides, web and command line, can work with the language equally well. He also mentions the developer/administrator split he sees in PHP's structure and how the language facilitates it.
389521
Time for a little nostalgia today in this new post from Philip Olson looking back at a brief history of the PHP acronym - where it came from and how it evolved to mean "PHP: Hypertext Preprocessor".   While reminiscing what PHP was like back in the early early years, I stumbled upon a little historical nugget from the old website. Do you know what the acronym PHP stands for? Many of us do, or think we do. [...] But how was the definition chosen? For fun, here's a look back at the official vote that determined this new meaning way back in 1998. It might be worth mentioning that Rasmus, the father of PHP, did not vote for the eventual winner.   He also includes a few "notable quotes that could be taken out of context" from Rasmus Lerdorf concerning his opinions on the matter of the acronym's meaning as well as some other brief notes on the history of PHP and its name change.
325308
This week's edition of PHP Magazine's PHPBarnstormer has been released - Issue #22.
703914
On his blog, Stuart Herbert has a quick tip showing how to mimic a feature of Ruby on Rails:   I'm still working on the next article in my series looking at PHP on servers, so in the mean time, check out this simple way to emulate Ruby's nice way of handling separate getter, setter and state query methods in PHP.   He admits his example isn't as elegant as the Ruby method, but it does get the job done. Code for the method is included in his post ready for cut and pasting.
757749
On the PHPKitchen site today, Demian Turner looks at a handy utility to ensure that the coding standards in your documents are all passable - PHP_CodeSniffer.    There was a fantastic CS helper package released at PEAR this week, PHP_CodeSniffer. The package, which requires PHP5 and is nicely coded, puts a phpcs script in your path so you can pass files or directories to it to get your CS validated.   The results are detailed and processing is surprisingly fast considering how many tokens are being parsed.    Demian gives an example of what the validation process looks like and why he finds the entire package particularly useful.
584229
Popular posts from PHPDeveloper.org for the past week:Reinhold Weber's Blog: 40 signs you really are a lousy PHP programmerScott Klarr's Blog: PHP Cheat SheetsDeveloperTutorials.com: Building Desktop Applications in PHPPadraic Brady's Blog: The Zend Framework and Microformats: Zend_Microformat ProposedCommunity News: GoPHP5 Project Wraps UpJob Posting: Technology Resources, Inc Seeks Senior PHP Developer (New York, NY)Job Posting: Red Ventures Seeks Sr. Systems Analyst/Web Developer (Charlotte, NC)Community News: Forage - A Search Abstraction LayerCommunity News: php|architect Launches C7Y Site (News/Podcast/Forums)Richard Heyes' Blog: SMTP for PHP 5
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.
696609
On his blog, Stoyan Stefanov takes a look at using on of the most popular pieces of PHP forum software out there - phpBB - and optimizing the front-end.   During this short workshop there will be no changes to the phpBB code, we'll create a new template instead, so that in case something bad happens, your board will continue to work normally. As an example, I'll use the bgcanada.com/phpBB2, the board I volunteer to administrate.   The tutorial is broken up into sections:   The plan New subdomains Creating a new template Moving CSS to an external file, merging Copying files to the new subdomains Serving gzipped content Turning ETags off Expires header Sysadmin summary   It looks like a lot of steps, but each section is relatively short and written well so as not to have more information than needed. In the end you'll have a simple template that uses Yahoo's 14 optimization rules to make things work that much faster.
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.
347638
In a new post on his blog, Kore Nordmann takes a look at a feature that's been around a long time (first introduced in a message board application) - BBCodes.   The discussion on my blog post "Do not use regular expressions for parsing" ended in a discussion about BBcodes in general. I just used them as an example to demonstrate why it it is impossible to parse such a language with regular expressions - and mentioned in a subclause, that I don't see any sense in using them at all.   He looks at some of the myths surrounding them and their use (more secure, easier to use, safer than HTML) and gives some reasons for making teh choice of HTML over them.
743840
Chris Shiflett has posted his own recap of the (just passed) php|works conference up in Toronto over on his blog.   I've been traveling non-stop since php|works, so I haven't had a chance to reflect on the conference, what I learned, who I met, and things like that. (Zak has been doing a good job of this lately, and I'd like to follow his lead.) I've probably forgotten more than I remember, but this is my recap.   Included in the things he mentions are:  The people he was able to meet (like Joshua Eichorn and Sebastian Bergmann) The talks he gave ("Truth about XSS" and "Agile PHP Testing") His interview with Cal Evans of the Zend Developer Zone The PHP 5 Certification and Wez Furlong's "Not PDO" talk
451108
On the SitePoint PHP blog today, Kevin Yank shares his thoughts in the form of a list for what makes for "good" and "bad" PHP code.   When interviewing a PHP developer candidate for a job at SitePoint, there is one question that I almost always ask, because their answer tells me so much about the kind of programmer they are. Here's the question: "In your mind, what are the differences between good PHP code and bad PHP code?"   Among the items on the list for the good side are things like: structure, consistency, security, and portability. He gives a bit of example code that shows the three levels of "goodness" in a script (using $_GET variables).