echo base64_encode(base64_decode(“PHP”)) -> “PHM=“ #php #consistency
-
-
Replying to @jedisct1
That makes little sense? Did you mean echo base64_decode(base64_encode(“PHP”)) -> “PHP”
2 replies 0 retweets 2 likes -
Replying to @SynchroM
No. “PHP” is not a valid BASE64 string, even without padding; there are leftover bits. But PHP doesn’t care.
1 reply 0 retweets 3 likes -
Replying to @jedisct1
Sure - Postel’s robustness principle? Why would you expect an invalid input to produce valid output? Or do you mean it should complain?
1 reply 0 retweets 0 likes
Replying to @SynchroM
It should do what it does most of the time with an invalid input, return an empty string (which is also dumb, but…)
8:20 AM - 19 Sep 2017
from Bonneval-sur-Arc, France
0 replies
0 retweets
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.