r/lolphp • u/i_make_snow_flakes • Nov 15 '14
new safe casting function RFC. casting "-10" to string is valid but casting "+10" is not..
here the comment where one user asked the author of RFC about this. I am not able to follow his reasoning. What do you think?
21
Upvotes
View all comments
Show parent comment
5
u/i_make_snow_flakes Nov 16 '14
I am not sure we need to bother about the details of internal implementation here. You see, just because the implementation of unary operators ended up supporting the +/- prefixs for integer literals completely, does not mean that +/- prefixed integer literals are not a separate construct.
What I am getting at is that, '+1' and '+ 1' are separate constructs logically, even if they are supported/implemented by the same code internally. I think the manual entry reflects this fact, and is in fact correct. Just my thoughts.