Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60102 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68958 invoked from network); 17 Apr 2012 19:37:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2012 19:37:02 -0000 Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 87.106.212.190 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 87.106.212.190 s15355703.onlinehome-server.info Linux 2.6 Received: from [87.106.212.190] ([87.106.212.190:51513] helo=s15355703.onlinehome-server.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/63-03996-D56CD8F4 for ; Tue, 17 Apr 2012 15:37:01 -0400 Received: from Hwhost2.local (unknown [209.104.70.126]) by s15355703.onlinehome-server.info (Postfix) with ESMTPA id EA647E40B0 for ; Tue, 17 Apr 2012 21:36:57 +0200 (CEST) Message-ID: <4F8DC659.6090402@hoa-project.net> Date: Tue, 17 Apr 2012 15:36:57 -0400 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20120415 Thunderbird/13.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: <4F8DC211.70107@hoa-project.net> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Make require*/include* behave like a function for returning values, and more From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") Hi Paul, On 17/04/12 15:31, Paul Dragoonis wrote: > I don't see any fundamental benefit to having this in PHP. Unexposed symbols can be interesting when instrumended code (for my concerns) or simply for security and safety reasons. So, benefits exist. > It doesn't work around any current restrictions in the language. What do you mean? > It just looks like extra fluffy magic that we could do without. No extra magic stuffs, just new interesting features. Allowing (require 'file.php')['foo'] or (require 'file.php')('foo') is consistent with the fact that a file can return an array or a function. And yes, it's kind of syntax sugar from a certain point of view but it could improve PHP experience without adding any magic stuff. It's just more consistent. No? Cheers. -- Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://lifc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/