Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33381 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67681 invoked by uid 1010); 23 Nov 2007 05:41:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 67666 invoked from network); 23 Nov 2007 05:41:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2007 05:41:31 -0000 Authentication-Results: pb1.pair.com header.from=andy@petdance.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=andy@petdance.com; spf=permerror; sender-id=softfail Received-SPF: error (pb1.pair.com: domain petdance.com from 69.17.117.6 cause and error) X-PHP-List-Original-Sender: andy@petdance.com X-Host-Fingerprint: 69.17.117.6 mail4.sea5.speakeasy.net Linux 2.5 (sometimes 2.4) (4) Received: from [69.17.117.6] ([69.17.117.6:44082] helo=mail4.sea5.speakeasy.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/81-52046-A0866474 for ; Fri, 23 Nov 2007 00:41:30 -0500 Received: (qmail 28310 invoked from network); 23 Nov 2007 05:41:27 -0000 Received: from rocket.petdance.com (HELO uniqua.petdance.com) ([64.81.227.163]) (envelope-sender ) by mail4.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 23 Nov 2007 05:41:26 -0000 Received: from mel.petdance.com (mel.petdance.com [192.168.2.6]) by uniqua.petdance.com (Postfix) with ESMTP id 0F70F5CD0055 for ; Thu, 22 Nov 2007 23:41:26 -0600 (CST) Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v912) Date: Thu, 22 Nov 2007 23:41:25 -0600 X-Mailer: Apple Mail (2.912) Subject: Cleanup and maintenance of internal C code From: andy@petdance.com (Andy Lester) Hi, I'm Andy Lester, and I'm usually a Perl person. I've worked on the Perl 5 and Parrot internals over the past few years, working to clean up the C code. The other day I was poking through the C code behind PHP 5.2 and saw some places that I thought I could help clean up. If the PHP core folks are interested (and I have no idea how you PHP people handle maintenance on things like this), I'd be glad to do some safety and stylistic improvements that should help make the code safer. The changes I'd be looking to make are: * Using const qualifiers on as many core functions as possible, * Using const qualifiers on variables to help ensure they don't get changed accidentally * Using variables in the smallest scope possible I've undertaken this task in Perl 5 and Parrot to great effect, and just had a little patch accepted here http://bugs.php.net/bug.php?id=43041 . In the Parrot project, I wrote a guide to the benefits of consting: http://search.cpan.org/~chromatic/parrot-0.5.0/docs/project/cage_cleaners_guide.pod#Why_consting_is_good It seems PHP is using const in some places, but many more remain to be exploited. Is this something you'd be interested in, or should I not bother? If so, how shall I begin? thanks, xoxo, Andy -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance