Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77147 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82333 invoked from network); 11 Sep 2014 03:02:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Sep 2014 03:02:47 -0000 Authentication-Results: pb1.pair.com header.from=park.framework@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=park.framework@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.52 as permitted sender) X-PHP-List-Original-Sender: park.framework@gmail.com X-Host-Fingerprint: 209.85.219.52 mail-oa0-f52.google.com Received: from [209.85.219.52] ([209.85.219.52:49810] helo=mail-oa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 31/80-13202-6D011145 for ; Wed, 10 Sep 2014 23:02:46 -0400 Received: by mail-oa0-f52.google.com with SMTP id jd19so1402849oac.11 for ; Wed, 10 Sep 2014 20:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=y7CTWnhK5Iikoa3T6BgWb74MJCFalaKvi7kojfe8qxc=; b=gkaIx9zrvZgHUhHnmh8AlFPoRKCyjvdg1gBEWKIAORm8OOlyBb0cw+q7xsT331eO77 zKWpREzxaLJiofw8BEjmLDa+UHODh37R5LFxawhldw3Kz2H5loBQAyUO6OQY/DvUozma 5K81dFAuhggsILdA8wOjS5ohVasEke/1F6M1JMmDH9E3CjwbCbFjs/H3gltPdDvnVCR/ QOmHZVCKf7p/w/aMXIX5KCtnQTXSYutkCfWzs+Zgrlu/V6p56FHPfTpmd4f07Js0UeCh sdSmHQGWTNP2zsXNw9K8w8m2fOOOhDvlYvQTBIBN44yMeMVUXTr9abuHHY5NSFA941G3 zPZw== MIME-Version: 1.0 X-Received: by 10.182.38.138 with SMTP id g10mr49330647obk.21.1410404563711; Wed, 10 Sep 2014 20:02:43 -0700 (PDT) Received: by 10.76.23.37 with HTTP; Wed, 10 Sep 2014 20:02:43 -0700 (PDT) In-Reply-To: References: <004d01cfcc63$e7e3ac40$b7ab04c0$@tutteli.ch> <3DB7DEC9-2F99-4DDB-95A9-70455E4BABCB@ajf.me> <54108D63.3070707@gmail.com> Date: Thu, 11 Sep 2014 06:02:43 +0300 Message-ID: To: Andrea Faulds Cc: Rowan Collins , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] make casts more strict in PHP 7 From: park.framework@gmail.com (Park Framework) > You know, =E2=80=9Cint=E2=80=9D, =E2=80=9Cfloat=E2=80=9D, =E2=80=9Cstring= =E2=80=9D etc. aren=E2=80=99t currently reserved words. We could add functi= ons, or even make them reserved words and add internal functions (=C3=A0 la= isset), so int(=E2=80=982=E2=80=99), float(=E2=80=982.0=E2=80=99), string(= =E2=80=98test=E2=80=99) etc. > > Or perhaps class-like constructors? $a =3D new int('2'); ? Would kinda ma= ke sense given some people want to add methods to primitive types. +1 $int instanceof Int $float instanceof Float $num instanceof Numeric $bool instanceof Boolean $str instanceof String $array instanceof Array This makes it possible not to use the is_*() functions. It is desirable to conduct instanceof fully consistent with behavior hinting casts, it would be logical and correct. Just wanted to be able to use these classes (or interfaces) to create their objects, these objects would pass inspection in hinting casts.