Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98514 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85087 invoked from network); 13 Mar 2017 05:11:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2017 05:11:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=michael.vostrikov@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=michael.vostrikov@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.176 as permitted sender) X-PHP-List-Original-Sender: michael.vostrikov@gmail.com X-Host-Fingerprint: 209.85.161.176 mail-yw0-f176.google.com Received: from [209.85.161.176] ([209.85.161.176:33282] helo=mail-yw0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/7F-38004-80A26C85 for ; Mon, 13 Mar 2017 00:11:36 -0500 Received: by mail-yw0-f176.google.com with SMTP id v76so52751118ywg.0 for ; Sun, 12 Mar 2017 22:11:36 -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=pDKg3enbZc8Fkw2OXtqkNru5mT91alqRRbz6HSGdCGU=; b=BFDrppLFHy663i20kL9t/bff62JkBLQ/VqqIc1E/HXqf9NAIKLmgu0/+xRTuut2S8E /59jv2IjDtETEehp/2a5OXmvgoQ/MlH+NNZZRBbF5uU54DDd7nSVBYS7Qv7q2wk3vhVY sQzFLDtCt5L4lU510RxuSo8CNzNB0uplu1p9cFe1QjB+90JWjjcflwTnMwaHr6esyaWs jHuXKkazQqPhtgrOiB1i+Ofyjue2shybQN/WoauoWXdjyC84O2NKZR5AuFPQrLWOCYCl 1Ft8AHuDPTb8NJNkxubIi9p292WkSFCPOdEqf+LU+lAYuituBs8CruW28DmyTGKHqwUn RjPw== 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=pDKg3enbZc8Fkw2OXtqkNru5mT91alqRRbz6HSGdCGU=; b=cEcg6sd6I+gOnnRvXDR+qky77nQfVwn5KW2AiLb5xzntUKFivQ7cd9t7JuY6A8L9VD +butYceaRqmIZrykS6WlU6SbZWN7xF0ARiYkBwFDAnJU4F1NmYVKmO85rLRBNMTMYGIy HII6cY4nEVxqiAd9dq39aJ8IRMSXN0Z8+nL3VeGIp0E0SF/sjGevQi04NCZ9FC20dGG/ ElAYE/BXwvKs5A7ocLl73PCbUdiyns4uz1wacqCu2pFSn9FawVeLd0xc1YQ8xc4qI3IH PI6HyBTyjc6OGKlgbovlfBXHN4weqUwjT4XTPQcZjC/eJVkBy7ZXUHj52YFLkdjQORA4 9log== X-Gm-Message-State: AMke39kh0bCPROZBavWVvA3akqfG9tQJr18Pr7q1MWxfWpJZ2muw8QYqHp6M/92trMD4+YBUqGEu9+DaR1Kmjw== X-Received: by 10.13.250.67 with SMTP id k64mr16360086ywf.125.1489381893018; Sun, 12 Mar 2017 22:11:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.224.196 with HTTP; Sun, 12 Mar 2017 22:11:32 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Mar 2017 10:11:32 +0500 Message-ID: To: Yasuo Ohgaki Cc: PHP Internals Content-Type: multipart/alternative; boundary=94eb2c07f34aab1a9b054a95be17 Subject: Re: [PHP-DEV] Type variants From: michael.vostrikov@gmail.com (Michael Vostrikov) --94eb2c07f34aab1a9b054a95be17 Content-Type: text/plain; charset=UTF-8 2017-03-12 23:01 GMT+05:00 Fleshgrinder : > As I said already, there is no problem if you just change the direction > of the inheritance. > Ok, how to inherit Rectangle, Square, Rhomb, all of which are Parallelogram? In your example Rectangle knows restrictions of Square and any Rectangle is instance of Square. It does not match domain model. 2017-03-13 1:40 GMT+05:00 Yasuo Ohgaki : > I pasted wrong URL. This URL has better example code. > > https://msdn.microsoft.com/en-us/library/w86s7x04.aspx > > Getters/setters is a good feature, I'd like them to be in PHP, but they should be placed in some classes. What are these classes? We still cannot use all squares as rectangles and some rectangles as squares without questions. And if we already have one $rectangle with w == h, we cannot just use it as square, we must create new object based on $rectangle data. --94eb2c07f34aab1a9b054a95be17--