Re: Scalar Type Declaration Syntax Weirdness

From: Date: Tue, 24 Nov 2015 16:47:55 +0000
Subject: Re: Scalar Type Declaration Syntax Weirdness
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-89385@lists.php.net to get a copy of this message
Hi Sebastian, Sebastian Bergmann wrote:
The following is currently valid PHP 7 code
      <?php
      function a(\int $i) {}
Is it intentional that the \ in front of the "int" is allowed? IMHO, this confusing notation must not be allowed.
This is weird and I'd consider it a bug. You can't do \array or \callable, and if I saw \int, I'd think it meant a class of that name rather than a scalar type. Can this be fixed for 7.0.0? Thanks. -- Andrea Faulds http://ajf.me/

« previous php.internals (#89385) next »