Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5601 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57322 invoked by uid 1010); 20 Nov 2003 06:09:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57258 invoked from network); 20 Nov 2003 06:09:48 -0000 Received: from unknown (HELO sunshine.home) (62.178.227.34) by pb1.pair.com with SMTP; 20 Nov 2003 06:09:48 -0000 Received: from mfischer by sunshine.home with local (Exim 4.22) id 1AMhjM-0002kX-0E for internals@lists.php.net; Thu, 20 Nov 2003 06:51:52 +0100 Date: Thu, 20 Nov 2003 06:51:51 +0100 To: internals@lists.php.net Message-ID: <20031120055151.GA9205@gjat.josefine.at> Mail-Followup-To: Markus Fischer , internals@lists.php.net References: <200311191124.56176.ilia@prohost.org> <20031119194049.GA9090@gjat.josefine.at> <200311191518.34382.ilia@prohost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200311191518.34382.ilia@prohost.org> X-Editor: Vim http://www.vim.org/ X-PGP-Key: 0xC2272BD0 at wwwkeys.eu.pgp.net X-PGP-Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 User-Agent: Microsoft Outlook Express 5.50.4807.1700.314 X-Spamfilter: Fighting it with http://www.spamassassin.org/ and http://razor.sourceforge.net/ Subject: Re: [PHP-DEV] validate_file() and strip_file() From: mfischer@gjat.josefine.at (Markus Fischer) On Wed, Nov 19, 2003 at 03:18:34PM -0500, Ilia Alshanetsky wrote : > On November 19, 2003 02:40 pm, Markus Fischer wrote: > > bool php_check_syntax($filename [, &$error_message]); > > I'll need to look at the code, it should be possible to do. Although I'd > prefer to have it return the error rather then return it by reference as an > optional argument. I understand. I might think it's just safer so one can assume the return value (bool) just gives information whether it works or not and the error message itself is a bonus. if (!php_check_syntax("myscript.php", &$error_message) { die ( "myscript.php didn't validaet: $error_message"); } vs. if (strlen($error_message = php_check_syntax("myscript.php")) > 0) { die ( "myscript.php didn't validaet: $error_message"); } I find the former a somewhat cleaner approach than the latter; or maybe it's just me. - Markus