Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99799 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84777 invoked from network); 6 Jul 2017 15:09:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jul 2017 15:09:25 -0000 Authentication-Results: pb1.pair.com header.from=michal.brzuchalski@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=michal.brzuchalski@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.180 as permitted sender) X-PHP-List-Original-Sender: michal.brzuchalski@gmail.com X-Host-Fingerprint: 209.85.128.180 mail-wr0-f180.google.com Received: from [209.85.128.180] ([209.85.128.180:36273] helo=mail-wr0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 70/C5-47109-3A25E595 for ; Thu, 06 Jul 2017 11:09:24 -0400 Received: by mail-wr0-f180.google.com with SMTP id c11so6795785wrc.3 for ; Thu, 06 Jul 2017 08:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XtlBNtLlDMG67sRBw3LInOsVdC+BBd/cnzfc5DGO+LU=; b=lCwUWXV1cCSjarzm2jlXbDGIK6dKCbqr5ZVcdOHBRzrPjLULNL7dMr0xdeOfFoJckG syHvw5Qgm1NB34alTv3FvwZejQ6fhmacKifQLSUno2pPCv01lH24VE6c8LCCWuTzPiFh pB7D6kKrF7RwfcudqIZuddpc2udDjcjB1G07Nu6H0Q6mawyrAJJejMHpN8KyS12+MfeV pxeEb6ANULZdWlbUQAXddW3Jdup2+zueu9WrMDL8YpQdOkcZ0A6I4IDuZQq3VyGw0tN6 T6vBi5hbmilLW82elWClWfkt2ho0KmIGQXRzSKL1sVrVUQPMzVnHQUDSHhhF3h6Y3X2C RlxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XtlBNtLlDMG67sRBw3LInOsVdC+BBd/cnzfc5DGO+LU=; b=U/hdUWEg7DlN1UA84ZkpOdXmJ2McTCPHvpGV/r0GUMyQ+TyAfujEjRDZeaCD++OdCn L2UBW99eNAQ44vb1ydBttvto0iul33r39gnJp4StdHLaROcziLoawPBzqm0KwNe7VFRg 94Rsn6dSFv6SGGVka2KhvQUy0NKpFBcNhxhTTBVXXmzU9McA2uVeXkzCq98IUxAEpcrY U8PsrXocv9vNIp0NvpqPLT8CygSQehcI5yF7mctC3hjqOd+21gdEa+6GblxvMJNpVxun +9tWBgAj3BDSsmuw0ieQ0NaRrBE7GLKle2rh25QGYUXRRr6jQgZ35PvASMAOdSZ47M1I 174w== X-Gm-Message-State: AKS2vOwzixwVHnauawBaYdGU/bITZigwwVn5w5ShYXciNZGz662LvPGg F550uZInkhfoIsqlZXKRt2DLEUy6Ow== X-Received: by 10.223.163.135 with SMTP id l7mr47519342wrb.88.1499353761112; Thu, 06 Jul 2017 08:09:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.134.13 with HTTP; Thu, 6 Jul 2017 08:09:20 -0700 (PDT) Received: by 10.223.134.13 with HTTP; Thu, 6 Jul 2017 08:09:20 -0700 (PDT) In-Reply-To: <1499348044.19635.101.camel@schlueters.de> References: <1499348044.19635.101.camel@schlueters.de> Date: Thu, 6 Jul 2017 17:09:20 +0200 Message-ID: To: =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: "Khawer ." , PHP Internals List Content-Type: multipart/alternative; boundary="f403045f146652ebcb0553a780b7" Subject: Re: [PHP-DEV] Partial Classes From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --f403045f146652ebcb0553a780b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 06.07.2017 15:34 "Johannes Schl=C3=BCter" napisa= =C5=82(a): > > On Do, 2017-07-06 at 13:11 +0500, Khawer . wrote: > > Partial Classes > > > > If we are using same class for different purposes we can extend it, > > and add new properties and methods. But we will also have to use new > > class name, when we create objects. C# provides a better concept > > "Partial Classes". Why not to also implement it in PHP? Because class in few files won't autoload and more files cause you don't have class in one place and switching through files may increase frustration. Also this would lead to ambiguity if you load few partial classes which uses methods from not-loaded one how can you know where to find it? > > > > Example: > > > > Partial Class abc { > > > > public function sayhi() { > > echo "Hi"; > > } > > > > } > > > > Partial Class abc { > > > > public function sayhello() { > > echo "Hello"; > > } > > > > } > > My understanding is that C# mostly uses this for GUI stuff where > forms/widgets are designed in a visual editor and code is written in > text. By using partial classes those can be in different files, thus > developers don't touch generated files. > > Except for that a need for splitting this up indicates a design issue > to me. Like a class doing too many things. > > PHP has traits which you eventually can use to emulate such a system in > a more explicit way. > http://php.net/traits > > > Q: What will happen if both classes contain same method names? > > A: We will show error method already exists. > > > > Q: Will it break any existing code? > > A: No, there will be no impact on any existing coding because we are > > not changing anything. > > It would break usage of "partial" which is not a keywor, yet. > > johannes > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --f403045f146652ebcb0553a780b7--