Re: [VOTE] [RFC] Alphanumeric Decrement
I would rather introduce a deprecation warning for decrementing (and incrementing) alphanumeric
strings. It’s just very bad behaviour and using chr() and ord() is not that hard :)
cu,
Lars
On 21 Jan 2014, at 21:16, Andrea Faulds <[email protected]> wrote:
>
>
> On 21/01/14 19:12, Yasuo Ohgaki wrote:
>> Added this RFC to keep track inconsistency.
>>
>> https://wiki.php.net/rfc/comparison_inconsistency
>>
>> Python/Ruby does not even have ++/--.
>> Mixing string and number raises type error for these languages.
>> Perl returns -1 for string-- always.
>>
>> Although behavior became more consistent than now, but
>> I'm not sure if this change is good or not.
>> Keeping current behavior might be better.
>
> This would also be my preferred approach. My RFC is one approach to resolving the
> inconsistency, but it's not what I really want, in truth. I'd like something like that
> you're proposing.
>
> However I think type juggling is entirely misguided, and should we do it at all, int ->
> string and float -> string should be one-way conversions. Doing the reverse seems like a bad idea
> to me.
>
> --
> Andrea Faulds
> http://ajf.me/
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Attachment: [application/pgp-signature] Message signed with OpenPGP using GPGMail signature.asc
Thread (19 messages)