Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103793 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78217 invoked from network); 23 Jan 2019 15:54:49 -0000 Received: from unknown (HELO relay.alfa-bank.com) (217.12.96.18) by pb1.pair.com with SMTP; 23 Jan 2019 15:54:49 -0000 Received: from localhost (unknown [127.0.0.1]) by IMSVA (Postfix) with SMTP id C7272F20C1; Wed, 23 Jan 2019 15:32:41 +0300 (+03) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alfabank.ru; s=mainstream; t=1548246761; bh=YrCNzbYGUxYSSs9CACnE18C9TtqebyHei0iVuugx75A=; h=To:From:Date; b=ZyAKOJ5z3yxK/stJ6nrUDfOxN3C8AaRCpYFC/jE0pPmwhicCOOsajEtuZDWXbY5gX ZzbLBppjcBPOd8y4xhFdqqHT9qSf207FdHOhOoglUo0heg4HBp+c8eMxdd23BEJLIj dFqYXRRyP1irX2phH5H6dSP5L4sBXXYl4G7otrIQ= Received: from relay.alfa-bank.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B7F4F20C1 for ; Wed, 23 Jan 2019 15:32:29 +0300 (+03) Received: from SMTP1.alfaintra.net (unknown [172.28.1.129]) by relay.alfa-bank.com (Postfix) with ESMTP for ; Wed, 23 Jan 2019 15:32:29 +0300 (+03) To: internals@lists.php.net MIME-Version: 1.0 X-KeepSent: 764776A9:5393FBCF-4325838B:0043B08E; type=4; name=$KeepSent Message-ID: Date: Wed, 23 Jan 2019 15:32:28 +0300 X-MIMETrack: Serialize by Router on SMTP1/Internet(Release 9.0.1FP7|August 17, 2016) at 23.01.2019 15:32:29, Serialize complete at 23.01.2019 15:32:29 Content-Type: multipart/alternative; boundary="=_alternative 0044E4AC4325838B_=" X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.1.0.1826-8.2.0.1013-24384.005 X-TMASE-Version: IMSVA-9.1.0.1826-8.2.1013-24384.005 X-TMASE-Result: 10--3.609800-10.000000 X-TMASE-MatchedRID: Q7GHbf2+kKM2UEKHDN0wzPVFR4sC8dPyvz6rXsYUspFTqGRAXj8KbUc5 A85pTadYCZUbMG/dc4PBuIyiTh7nwCXfrNPRKZ13F6z9HGHKwNtPn74Ug5EKEKMLUT/MIQiv9vR 66QHzxgtZ4LHtmfWcx3xP9NZSUxu3VYkVwZtUvND/McoAQhls9AYAPqHoVmYRt5YP32FP93CjxY yRBa/qJeBPbNdhr3+dWKD2QKkwR8LQLWxBF9DMQTpcQTtiHDgW8oQ3qwzL3J4EK8mXViggFNmbB KQWZuT4kRpa+t3lKJayWLmWCO4qwYRj6lc3uWDSncZQ+QTmqH5A2Gzy9PPaweSm29okHsywqb75 gDGHkCUX3pz5dY9mkwqNE0KIvhSGX/dXyL6n1Fnr4nOTIlgIM7pU9vPG/0rTs8JTcotQf3LEozV DICrux16UXQtZ6MyMnqg/VrSZEiM= X-TMASE-SNAP-Result: 1.821001.0001-0-2-1:0,12:0,22:0,33:0,34:0-0 Subject: Proposal fo "Code-free constructors declaration" From: AGromov@alfabank.ru (Andrey O Gromov) --=_alternative 0044E4AC4325838B_= Content-Type: text/plain; charset="US-ASCII" Full description https://wiki.php.net/rfc/code_free_constructor Draft realisation https://github.com/php/php-src/compare/master...rjhdby:constructor "Code free" constructor is constructor with only purpose to directly set object properties from received parameters and, optionally, call parent constructor. Main idea is to move such constructor declaration inside class declaration. Simple example: Current syntax class A extends B{ public $prop; public function __construct($prop){ parent::__construct("BlaBla", $prop); $this->prop = $prop; } } Proposed syntax class A($prop) extends B("BlaBla", $prop) { } With respect, Andrey. --=_alternative 0044E4AC4325838B_=--