Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92809 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20634 invoked from network); 26 Apr 2016 17:41:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2016 17:41:37 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.220 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.220 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.220] ([81.169.146.220:32450] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/17-20013-F48AF175 for ; Tue, 26 Apr 2016 13:41:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1461692492; l=3789; s=domk; d=kelunik.com; h=Content-Type:Cc:To:From:Subject:Date:References:In-Reply-To: MIME-Version; bh=U8Uy8IcrbkjPyWwLtpDG6bI29hoxdXpXosrokuo2sSs=; b=S0/Wih41cWYrAgwtrE4L8e/xf8i9aRPYtUAhlzI+pJ8F0T62EWE8Luo4qUQf2RwNSVw ruOzKIqIV9kZy3vRTK8AFcjVWLpDmofDcLutHe6FKCoxj/M+nYSE03yPti7GGYGgju7uM JwkFOuvvEyRMKjbXYupTYRUAaTS9pAWqZXQ= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3A6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f43.google.com ([74.125.82.43]) by smtp.strato.de (RZmta 37.24 AUTH) with ESMTPSA id j00ac5s3QHfVq4X (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Tue, 26 Apr 2016 19:41:31 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id u206so16100256wme.1 for ; Tue, 26 Apr 2016 10:41:31 -0700 (PDT) X-Gm-Message-State: AOPr4FXbwfuRJGIc0u48XJOIW3Td+v0Kdv0iBvHhTKVxR8VTgkeqky46j4h7mojxUOCm7t0vad0SWDsuagulRg== MIME-Version: 1.0 X-Received: by 10.28.19.140 with SMTP id 134mr5211947wmt.73.1461692491654; Tue, 26 Apr 2016 10:41:31 -0700 (PDT) Received: by 10.28.93.145 with HTTP; Tue, 26 Apr 2016 10:41:31 -0700 (PDT) In-Reply-To: References: <571F7B91.2030102@zend.com> Date: Tue, 26 Apr 2016 19:41:31 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Bob Weinand Cc: Levi Morrison , Dmitry Stogov , internals , Joe Watkins Content-Type: multipart/alternative; boundary=001a11471162bc8f34053166cd35 Subject: Re: [PHP-DEV] [RFC] Patch for Union and Intersection Types From: me@kelunik.com (Niklas Keller) --001a11471162bc8f34053166cd35 Content-Type: text/plain; charset=UTF-8 2016-04-26 19:33 GMT+02:00 Bob Weinand : > > Am 26.04.2016 um 19:00 schrieb Niklas Keller : > > > > 2016-04-26 16:58 GMT+02:00 Bob Weinand : > > > >> Yeah, I'd like to not allow ?Foo in any case if union types pass. > >> > > > > What's the reason for that? To me, null is neither a type nor should it > be. > > I don't want to argue that now, but null most definitely IS a type. It is > the null type with a single value, null, whose semantics is to represent > the absence of any other value. > > There's also plenty of evidence in PHP that null is considered a type: > get_type(), https://php.net/null, has it's own is_* function etc. > At least in the PHP ecosystem it is considered its own type. Other type > systems may not, but the one of PHP does. > > Thus, we are definitely considering it as a type - a question for you: > What's the type of the value null then, if not null? > I'd say it's special and doesn't have a type at all. No value, no type. > If we wouldn't make a distinction between null and an object (i.e. allow > null to be passed to a function(Foo $foo) {}), it could be considered a > supervalue of type object. But that's not the case. If null doesn't have a type, it's clear that it can't be passed to a function(Foo $foo) {}. --001a11471162bc8f34053166cd35--