Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78692 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52518 invoked from network); 5 Nov 2014 00:42:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2014 00:42:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.172 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.172 mail-ob0-f172.google.com Received: from [209.85.214.172] ([209.85.214.172:52974] helo=mail-ob0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/28-02095-D7279545 for ; Tue, 04 Nov 2014 19:42:38 -0500 Received: by mail-ob0-f172.google.com with SMTP id wp4so11788877obc.17 for ; Tue, 04 Nov 2014 16:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=XL1BmjyNhAlIj/utBb44pxCxpVLDyfFkuEh/LpTL4v8=; b=FBjuAWoHvvo20DlcSRqgoDrCk2Rip6DoqwDg4zYMfJf/WCrKUPnNpkQ+PXwlbTKlAT DTIaDj/eC/5AliEZINLTYYMgUXgg7FWx/m3nSuT0AzFEK3/eWi2Wvd3xyvMenb6M3w4/ IMb+hTvB9DVLjh4r5AsBbZDM9wew1QLKns9CQBMKhDU2iQl2cLYmfplzmao14gMEqonp RP6RnYO6CQLoE+9r3wyQ+rhim+hehQ0shOC9m1SCPejTlWWt8w7f3e7s5cGQWURG+Sjs Pcx9MnSp0HuPUo7J3d8J+sj7mh+doHxqKGwJw8ZU4FO4HWBWUMnFya4BhU38mZFzKStj VtCA== MIME-Version: 1.0 X-Received: by 10.202.178.131 with SMTP id b125mr4597650oif.72.1415148154861; Tue, 04 Nov 2014 16:42:34 -0800 (PST) Sender: morrison.levi@gmail.com Received: by 10.76.159.163 with HTTP; Tue, 4 Nov 2014 16:42:34 -0800 (PST) In-Reply-To: <545917A2.6000206@lerdorf.com> References: <002601cff777$eb923430$c2b69c90$@tutteli.ch> <000601cff80a$972e0250$c58a06f0$@tutteli.ch> <5458937F.9020304@sugarcrm.com> <545910F1.8030904@sugarcrm.com> <859A97F0-7C58-406A-857B-557F8AA657AD@ajf.me> <545917A2.6000206@lerdorf.com> Date: Tue, 4 Nov 2014 17:42:34 -0700 X-Google-Sender-Auth: wKjA4_T1O0EZ9xmdESuW_o7oP_A Message-ID: To: Rasmus Lerdorf Cc: Andrea Faulds , Stas Malyshev , Leigh , Robert Stoll , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Types on the right or on the left From: levim@php.net (Levi Morrison) >> If we used this syntax instead, which wouldn=E2=80=99t disrupt grep: >> >> public Foo function bar(); >> >> It=E2=80=99d be inconsistent with normal function declarations which wou= ld have to have Foo after function. > > I don't understand that inconsistency. > > public Foo function bar() { } > > looks perfectly sane to me. PHP's syntax was very heavily influenced by > C from day 1. In C you have: > > static int bar() { } > > In PHP the 'function' keyword indicates what follows is a function. > Putting something in between the function keyword and the name of the > function would confuse me. To me "function bar()" is inseparable and is > equivalent to "bar()" in C which makes the above examples consistent > with each other. Except `static function()` and `static function foo()` already have meaning, and if we allowed static return types (very possible) that would be ambiguous. This syntax is a no-go.