Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58825 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24510 invoked from network); 9 Mar 2012 17:45:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2012 17:45:24 -0000 Authentication-Results: pb1.pair.com header.from=simonsimcity@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=simonsimcity@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: simonsimcity@googlemail.com X-Host-Fingerprint: 209.85.214.170 mail-tul01m020-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:55753] helo=mail-tul01m020-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/03-02228-3B14A5F4 for ; Fri, 09 Mar 2012 12:45:23 -0500 Received: by obbwd1 with SMTP id wd1so2559336obb.29 for ; Fri, 09 Mar 2012 09:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CHZDxjHXaJSqeHNajt1tjgS9vOYZStXqhlvHFHZeuoY=; b=MGKOAR8BHAaf1fbR4eKFyNx3x8JdWFLrTY5APoXJojXD2yAMrCoGvKyKslKZeG2T/p C1dmawAbmLGVqMKWhNMrZ3PXH1tinn7+vr5T4U8Z9jXpjgGq/K2+eSUNVsNVR536j4Ky 01So+LZx+1UudwtGbYzE9EnnKqxeY2EupcyYcdyqxARV2VJjcrTINd8jqYUv1L8w+JMH kpvOJW0ivgeD6DDhaPW1UNvJsNKrWcjMFGQDAsGmdEk4iV8D+3q7NE1n93b+Btd8NDcj 44cvekuNiskAivByCPK3O2He1eRWH/KwPoD0G8nuVDwHCTumtNhVjvrWku7kQXbMOKtS xrmw== MIME-Version: 1.0 Received: by 10.182.155.68 with SMTP id vu4mr1227739obb.61.1331315119831; Fri, 09 Mar 2012 09:45:19 -0800 (PST) Received: by 10.60.63.70 with HTTP; Fri, 9 Mar 2012 09:45:19 -0800 (PST) In-Reply-To: References: Date: Fri, 9 Mar 2012 18:45:19 +0100 Message-ID: To: Lazare Inepologlou Cc: Anthony Ferrara , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [POC - Patch] Scalar Type Hinting - A-La zend_parse_parameters From: simonsimcity@googlemail.com (Simon Schick) 2012/3/9 Lazare Inepologlou > > Type casting combined with passing by reference is problematic in many ways. Just an example: > > fuction foo( string & $buffer) { ... } > foo( $my_buffer ); > > Here, $my_buffer has just been declared, so it is null. Should this be an error? I don't know! So, I think that that passing by reference should not be (immediately) supported. > Hi, Lazare This should at least throw an E_NOTICE :) And also an error as NULL is not allowed here. Let me modify your example: fuction foo( string & $buffer = NULL) { ... } foo( $my_buffer ); This would only raise the E_NOTICE because the variable has not been declared. Or would you say that NULL is equal with an empty string (talking about implicit casting)? I would not like that, but if, don't let it be (int)0 or (bool)false as well. Bye Simon