Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94400 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72556 invoked from network); 6 Jul 2016 09:25:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jul 2016 09:25:34 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wm0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:37201] helo=mail-wm0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/90-63547-E8ECC775 for ; Wed, 06 Jul 2016 05:25:34 -0400 Received: by mail-wm0-f44.google.com with SMTP id a66so184535726wme.0 for ; Wed, 06 Jul 2016 02:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:to:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=tdVJSOMgFlZ8e6CE1NoRq8qO40SKvQ52RnJUAr6xd7k=; b=KeR/R3Mlgq/JRzklzrtu+CBUhFcHYRfZk2dYB6/cjYkwXOC0rZSwS2pD8vHryyLJOR nRRYUPDJ96pN4WVZ8/RAxXDC2kss1vkXWG7G9jFVn0dfInCG6Et8EP/9HX9MQmo49XMR X8M/AlFxU5EYPbJMmswMMEgfkP+ujmO5Ow93Go/sOP8xsDnEPIGUiWE4ffAsv2m2hPW7 lFdtmJF4mTD8802vPlMBVtapq6FTbcaIHoXb9JBpNhoY3CgJunGQ7EETFyO+2OO8fooN O45sR5xOMBUusnXWxzFPj0qnmRCmo5WOIgZX4mZwWI/+7/85hGUIQZCE/78SrKmbDQIu RumQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:from:to:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=tdVJSOMgFlZ8e6CE1NoRq8qO40SKvQ52RnJUAr6xd7k=; b=gScQIkcEoxH8rAL7JWLlEVDSmrhTvxjq/RYHdfFX39OKq7dgTpKRXWm8omPnyEA2qs WnawGxZruV1uxMnw3UrJl6yzHb9e45NtGvNsaINdXVs5Ixt7jvzSi9vH7PrBk2/Y5uxg O8LB6vpkzq3E/ktFFEJF245hibwq66BoiKyMDl2aOS4jXVXh2qNTIOJPJvSNeYxrib+g 56NIoyEVLpg3WqciHyTF5nDF9p+hBfsktlZ87lJe6Ca4GAHVfQxeGrky3+LIPA7jmI9W AaU66jM2/0tgPNFAvUWbIOYC8V9XLSHBnZvWDS7z22q8X7+YCW20C57mbE3Jz1pnSPZB cZ2A== X-Gm-Message-State: ALyK8tJS/zNlOxT3T3x/aIrMAWzMDNewqeh9DZGXFpVRpgFdu0EZvf3pHjv90a3by/GqIA== X-Received: by 10.194.110.1 with SMTP id hw1mr19666332wjb.133.1467797131106; Wed, 06 Jul 2016 02:25:31 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id z1sm5519013wjh.14.2016.07.06.02.25.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2016 02:25:30 -0700 (PDT) References: <1f39f97a-6aaf-8550-9f82-a7e80465f903@telia.com> To: internals Message-ID: <319e2640-4f81-7b13-5135-be406e35c814@gmail.com> Date: Wed, 6 Jul 2016 10:23:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][Vote] ReflectionType Improvements From: rowan.collins@gmail.com (Rowan Collins) On 05/07/2016 22:06, Levi Morrison wrote: > Compare that to using only if-else for control flow: > > if ($type->isBuiltin()) { > handle_builtin(); > } else if ($type instanceof ReflectionClassType) { > handle_class($type); > } else { > handle_undefined($type); > } > > I'd much prefer the latter. Yeah, I agree the control flow looks more natural with an elseif there. But that fits fine with my other suggestion: if ($type->isBuiltin()) { handle_builtin(); } else if ( object_type_exists($type->getName()) ) { handle_class($type); } else { handle_undefined($type); } As I say, if you dislike the verbosity and future-proofing of "class_exists() || interface_exists()", then that's not uniqe to this situation, but a general lack in the language. Why add methods or whole types to this one area of reflection rather than providing a more basic building block? > It would have been great if people actually contributed to the > discussion before voting phase, but such is life. Yes, for my part, I apologise that I didn't pay any attention to this RFC previously, and just happened upon this sub-thread. I can understand your frustration at this all coming so late. Regards, -- Rowan Collins [IMSoP]