News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Patrick Allaert's Blog:
Coding standards converts PHP4 style constructors to PHP5 one
October 30, 2009 @ 07:51:39

Patrick Allaert has put together a shell command that can take your PHP4 code and replace its current constructors with PHP5-formatted ones.

It assumes your classes are always declared with the class keyword starting at the beginning of the line and that your files have the .php extension.

It uses a regular expression in a perl command to search through the current directory and look for the ".php" files to replace the "function ClassName" sort of thing with a "function __construct".

0 comments voice your opinion now!
code standards php4 php5 constructor perl convert


blog comments powered by Disqus

Similar Posts

DevShed: Building a PHP 5 Form Processor - Coding the Form Generator Module

Jani Hartikainen's Blog: A simple way to make your code better: Stop adding more parameters

David Coallier's Blog: Simple DBAL, PHP5, Light, Fast, Simple.

Robert Ames\' Blog: Upgrading from PHP4 to PHP5

PHP Magazine: Two New Polls - CMS Features & PHP5 Choices


Community Events





Don't see your event here?
Let us know!


refactor testing wordpress laravel podcast opinion framework threedevsandamaybe code introduction configure install community developer interview unittest release list series language

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