Re: Naming of 'weak' type hints

From: Date: Tue, 31 Mar 2015 15:19:22 +0000
Subject: Re: Naming of 'weak' type hints
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-85590@lists.php.net to get a copy of this message
Pavel, > Hello, > > I would definitely stick with "weak"; it is common naming used across > many languages and textbooks. > > Also, why is the strongly typed mode named "strict" anyways? If > anything should change, it should be strict to strong, so PHP doesn't > look like a special snowflake. Strong has a very specific meaning, which PHP is not using. For example, Python variables are strongly typed (meaning it's restrictive about how types are intermingled). So while "x" + 3 in JavaScript (another weakly typed language) is "x3", in python it would be a type error (assuming "x" + 3). PHP's overall type behavior is still weak at the variable level. The difference is that strict type declarations require types to match at the point of parameter passing. But it doesn't make the variable strongly typed. As far as "weak", that's the description of the type system in general. However as far as type declarations are concerned, I think it would be fair to talk about the two modes as "coercive" and "strict". Anthony

« previous php.internals (#85590) next »