Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96297 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32295 invoked from network); 9 Oct 2016 06:56:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2016 06:56:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=sebastian@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sebastian@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 188.94.27.5 as permitted sender) X-PHP-List-Original-Sender: sebastian@php.net X-Host-Fingerprint: 188.94.27.5 scarlet.netpirates.net Received: from [188.94.27.5] ([188.94.27.5:48240] helo=scarlet.netpirates.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/3A-20821-8F9E9F75 for ; Sun, 09 Oct 2016 02:55:53 -0400 Received: (qmail 15005 invoked by uid 89); 9 Oct 2016 06:55:49 -0000 Received: by simscan 1.4.0 ppid: 14997, pid: 15000, t: 0.0408s scanners: attach: 1.4.0 clamav: 0.99.1/m:/d:20700 Received: from unknown (HELO ?192.168.178.24?) (php@sebastian-bergmann.de@84.165.79.22) by scarlet.netpirates.net with ESMTPA; 9 Oct 2016 06:55:49 -0000 To: internals@lists.php.net Message-ID: Date: Sun, 9 Oct 2016 08:56:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Reflection API and Nullable Types From: sebastian@php.net (Sebastian Bergmann) At some point in time during the development of PHP 7.1 this code function f(?int $x) { } $f = new ReflectionFunction('f'); var_dump((string) $f->getParameters()[0]->getType()); var_dump($f->getParameters()[0]->getType()->getName()); printed string(4) "?int" string(3) "int" and now it prints string(4) "int" string(3) "int" I know that this issue (or a similar one) was recently discussed but after reading through that thread I am not 100% sure whether the current behavior is indeed the intended one. Thanks! Sebastian