Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59431 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51830 invoked from network); 7 Apr 2012 17:18:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2012 17:18:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:52366] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/BC-23111-4E6708F4 for ; Sat, 07 Apr 2012 13:18:29 -0400 Received: by wibhm17 with SMTP id hm17so1134144wib.11 for ; Sat, 07 Apr 2012 10:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=HIpMq3CRA9F5SvQddCHvJRSu3H1F3kfSVxsy0rE0lLM=; b=d07CgnQwgPv7ltCU3hbXCgmuBepLQT95qk9G0030zQl9fWHctNYfvc5b0qhcScuf4b wi5trhT6syFec7wWieZyr4eFePh2aGv8jO2yYGuIlQhjcRL2GiIo57miCry2kQu2ya5c bnDRvZV1tq72jGNbdfhi3Xk7eEegeg9cxt5gov6l8wMBQQsUtWJNMsv5n+DKIdNeZODB m35lhgGZZoaYRrcoX3sUefh+EpgKRowCFh5TdEaZManK2Z93o/5Br/chnHCzQxsMs+32 a4RzC4ILnzSePd02xAuch/XZxE/GJVOPfCgQ+ijiIyWSD8UXAuUxhwxCcoMM18JfBCKg UKog== Received: by 10.180.100.2 with SMTP id eu2mr4254549wib.1.1333819105321; Sat, 07 Apr 2012 10:18:25 -0700 (PDT) Received: from [192.168.1.26] (82.Red-81-32-56.dynamicIP.rima-tde.net. [81.32.56.82]) by mx.google.com with ESMTPS id ff9sm16084388wib.2.2012.04.07.10.18.23 (version=SSLv3 cipher=OTHER); Sat, 07 Apr 2012 10:18:24 -0700 (PDT) Message-ID: <4F80781B.8090503@gmail.com> Date: Sat, 07 Apr 2012 19:23:39 +0200 User-Agent: Thunderbird MIME-Version: 1.0 To: John Bafford CC: PHP Internals References: <03FFDCA3-90B2-48CA-B102-7562E0E9CA45@zort.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] PHP class files without On Apr 7, 2012, at 10:53, John Crenshaw wrote: >> What if you have just ONE function with a variety of options? Something like: >> >> execute_file('path/to/foo.php', array( >> 'require'=>true, >> 'once'=>true, >> 'begin_code'=>'> 'shorttags'=>array(''), >> 'autoescape'=>function($str){return htmlentities($str, ENT_QUOTES | ENT_HTML5, 'UTF-8');}, >> ... >> )); > While there's some elegance with your execute_file (there'd definitely be benefits to one function instead of the four we have now), the extra options would spawn so much Daily WTF material it wouldn't be funny, and I think most people would just stick with include/require/*_once because there'd be a lot less effort in the common case. I agree that the free-form tags could lead to much Daily WTF material, but there's a simplett reason to reject it: The tags are hardcoded in the lexer. Making it anything can drop perfomance. However, they could be possible as booleans, just as many of them are now in php.ini. And I like the idea of providing a function for auto escaping