Re: Scalar type hints and scalar type name aliases cause confuson

From: Date: Tue, 13 Oct 2015 13:37:19 +0000
Subject: Re: Scalar type hints and scalar type name aliases cause confuson
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-88774@lists.php.net to get a copy of this message
Hi, Peter Cowburn wrote:
On 13 October 2015 at 11:59, Andrea Faulds <ajf@ajf.me> wrote:
Hi Peter, Peter Cowburn wrote: The manual uses them almost exclusively,
Not for type signatures it doesn't. It usually uses "int" and "bool".
I said "almost" for a reason. More clearly, we use the long names in prose and by convention the short ones in the function prototypes.
Oh, right. My bad.
I would say that more confusion will arise from trying to use something that comes naturally (e.g. "integer") and getting an error, than having it "just work".
People might be slightly surprised it's not allowed, but it'd be very clear what was wrong with the code and how to fix it, so it's not really a problem.
So what if there is more than one way to say "hey, I want an integer here", particularly when they're super-duper common terms that are used everywhere. (I'm talking about "boolean" and "integer" specifically, however if someone wants to use "long", or "double", or "real" then why the hell stop them?
They're not used in source code much, though. Thanks. -- Andrea Faulds http://ajf.me/

« previous php.internals (#88774) next »