Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96577 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16054 invoked from network); 24 Oct 2016 05:48:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Oct 2016 05:48:55 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.181 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.181 mail-pf0-f181.google.com Received: from [209.85.192.181] ([209.85.192.181:36081] helo=mail-pf0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0E/67-28528-4C0AD085 for ; Mon, 24 Oct 2016 01:48:54 -0400 Received: by mail-pf0-f181.google.com with SMTP id e6so91989586pfk.3 for ; Sun, 23 Oct 2016 22:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=DOGWLZA1ayEc4m40P5usib8rN8gXvR+NGHAVyFsJkFs=; b=EBx9nazjlPcsr+TxhKNB6ptzld/+RscxkR/eMI76sH2SVKdjCreFFN2Yv0ayU2DBSa FDKan7kSvdtKvruh9/JB3V+/wiPLP428Gsn36VKzVpN7TeK0x2DhZyl8UZHUViXAGrTX 1qps6zf83c7Vvg8YY6kgdQXu1XYJY0/IfQzUDlKR0mmKK/Y0ufOJyy09I4auk+F0LHRl RTS2moLr76lUNqS4XLx3KiKrT1kjRbFHtIrboyuYJSrHmNPiAO9Z3pOUMIkcAAwzyisR 6X1kvkybh+FG/lsP0y33ZUAnHjC55wev2cRMA8FcgveCDSCnYnQwKvt4La0vo2u6QJYz oBtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=DOGWLZA1ayEc4m40P5usib8rN8gXvR+NGHAVyFsJkFs=; b=HWcNKDVdaEwNpnYUFlThvRzIsK/P48ofS5Jx6FbPqC4Axe5Nhx/3FZ77nQyrCTIPdn STedwVZ4szZgW8Bzsnf6/ktLvSB0KiM7BEG7X3b0EC641c/e9CWrPtSlnL9V2hl4aAhY RFkWmdyP9I1+lF+ni50Nq2PpD+EM+JV1nIxb74r8p9DxVTRT4UNvxW3Wm+FmHbiEYNV2 +s5h626mjTrJZYrd1Cqj9x6OJE05DhRfuLlXkXJQBuqeX+T3VeYdJpaWLLO8yN2ga84Q IbPCS++jDohyBCWy0lAYEEHPYKB2IfhF6pFuY7w5W11fAWFXswWYfmsKKAZJvpLRl1Xp E4nQ== X-Gm-Message-State: ABUngvdfYntZX4tI/x675x1eFWVZeVODNIBGOVZ+oMIIqIcM9Kf+UAY6KtKz8uVNq/mDvw== X-Received: by 10.99.111.67 with SMTP id k64mr21295239pgc.14.1477288130068; Sun, 23 Oct 2016 22:48:50 -0700 (PDT) Received: from Stas-Air.local ([2602:306:ce9c:e680:1890:46a7:9aa1:a4af]) by smtp.gmail.com with ESMTPSA id c15sm21579576pfd.53.2016.10.23.22.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Oct 2016 22:48:49 -0700 (PDT) To: Stephen Reay References: <1e7da1db-9fc6-a3ce-9cba-b219af2dd7d4@gmail.com> <7F1CFE1E-48A4-450E-BFD5-645100A16AE9@koalephant.com> <6b490ba3-ad2d-2a2b-9117-de53ce7fea7f@gmail.com> Cc: =?UTF-8?Q?Micha=c5=82_Brzuchalski?= , PHP Internals List Message-ID: <6954f170-bd74-310f-9ae2-23bda498603d@gmail.com> Date: Sun, 23 Oct 2016 22:48:47 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Object type hint From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Like I said, the functionality is possible without it. But what > functionality was impossible without int/float/string type hints? I don't think it's a good argument "if we added something to the language, from this point on anything can be added because why not?" Yes, you can write code in machine code, and yes, we don't do that, but that doesn't mean any addition to syntax anybody can think of automatically is in because we once added syntax. > They just make it much clearer, with less repeated boiler plate, what > arguments you can actually accept. I don't see how it's less boilerplate - in most cases, you don't even need it, as I said, since checking for object is in most cases is useless, you need to check for specific type. You don't use -> on just random object. You use it on an object because you expect to find something on the other end of -> and only objects of specific type(s) would have it. In very rare cases where it might may make sense, using is_object is only marginally longer and is very clear. It's not like it's some weird obscure function that takes ages to understand. -- Stas Malyshev smalyshev@gmail.com