Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94476 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94569 invoked from network); 11 Jul 2016 19:56:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2016 19:56:12 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.178 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.178 mail-yw0-f178.google.com Received: from [209.85.161.178] ([209.85.161.178:34705] helo=mail-yw0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/C1-17655-CD9F3875 for ; Mon, 11 Jul 2016 15:56:12 -0400 Received: by mail-yw0-f178.google.com with SMTP id i12so101521638ywa.1 for ; Mon, 11 Jul 2016 12:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RyOqanGeDEkbIc8GsUF+faaKIrfFh7ovEhfELf2fgxw=; b=0UvmDHggjvbJ+T2qQTB0DeXUNc/kojtngTSvBHWP7IM+cMQ2yb7D1wLZ8mwUYrPHAr G5ZrVPxYVFKWTSwFgTsb3yq6H9K0ea5h/z0+kuu7vGyfojrULuC8xSNrc9bRgqc5lWck ZiJFmpJdgko6d0DTd7sHEYeX5CdLAc5EdWh5Km6rh7TuZAlpSmCbsZYknEztNZre9VwW WfcVhC5xVqIGcCr7KR5unnDuloNiMEcpl+KEYZ4XCP3JOXQVMmAkkPwOOqGMyblcoMro TzMoBAFZmF2UcQIbStD8F+Aa2j2AYzObGgdKtPXWXPt8CjTjHkmjQgOSzguNUGQuz7lQ YFeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RyOqanGeDEkbIc8GsUF+faaKIrfFh7ovEhfELf2fgxw=; b=CsxYHO912j1XXN+1U3i+LO2/iG7LTwJ/3EBfNpeQ9aHJLlin5y+mtlLzcUeZ5cuRcZ Dd6iHzj+ASZluQfV70vX6aLgvB/O5Igr4tQlHjlPJMGUZeDxdMIzoSvugtxb2htYJRFj 8qvCt0PlkrGctddOcYr+ta3yZkkCi778yl0T7sCBu4V4TecneFGX/qgu7AVFmzl3+fHl axk/UWmhWsb+w/s9zVYK5DPySz7LJT93nnb1v3FFRfKUulv6guNQNxc/0qebvn9K/DXx g+H3kTvwWBPldkLSOgiKKw3PPEY9zS1QIgi8//8W5ZJ8WI8b0Iw2K3iYzu4qVbs3pySn 8AgA== X-Gm-Message-State: ALyK8tJQ/kOz36cTYIXkcXfZLHc2alcR+3UeVcmALrvF3aNGo2LGpGtqXYbSklCxHb7ddfoRgBrF7HED9v10Xw== X-Received: by 10.37.74.67 with SMTP id x64mr13701410yba.158.1468266970415; Mon, 11 Jul 2016 12:56:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.131.129 with HTTP; Mon, 11 Jul 2016 12:56:10 -0700 (PDT) In-Reply-To: References: Date: Mon, 11 Jul 2016 21:56:10 +0200 Message-ID: To: "Khawer ." Cc: PHP internals Content-Type: multipart/alternative; boundary=001a113e70b4350fdc0537618b19 Subject: Re: [PHP-DEV] Assign return value of function to property or replace parse error with nice fatal error From: nikita.ppv@gmail.com (Nikita Popov) --001a113e70b4350fdc0537618b19 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 11, 2016 at 9:39 PM, Khawer . wrote: > It would be better if we can assign return value of function to property. > > If not at least we should generate a nice error message. > > Currently when we try to assign return value of function to property we get > the following error: > Parse error: syntax error, unexpected '(', expecting ',' or ';' in > index.php on line 4 > > We should replace this error with the following error: > Fatal error: You must assign a static value to property in index.php on > line 4. > OR > Fatal error: Dynamic values cannot be assigned to property in index.php on > line 4. > Since PHP 7 the error message is: Fatal error: Constant expression contains invalid operations Nikita --001a113e70b4350fdc0537618b19--