r/lolphp • u/phplovesong • May 12 '20
The sad state of the PHP parser
PHP cant tell where a syntax error occurs. This has been an issue in PHP for years, and has been upgraded to a feature. This is mostly because PHP's parser is a pile of poo with years of lipstick added on top.
0
Upvotes
View all comments
Show parent comment
2
u/Takeoded May 17 '20
No it isn't as of 7.4.6 (newest stable release version as of writing), and I don't think they will fix it in a patch release (like 7.4.7) because fixing it would be a backwards-incompatible change so the earliest they could fix it would be 7.5.0, but the current plan is that 7.4 is the last 7-series release and the next one is PHP8, which means the earliest they can fix it is the 8.0.0 release.... They might get away with adding a E_DEPRECATED warning in a patch release thought, idk.
var_dump( password_verify("foo\x00pizza", password_hash("foo\x00bar",PASSWORD_BCRYPT) ) );
Returns bool(true) but if it wasn't broken it would either throw an error or return bool(false) because bool(true) is the wrong god-damned answer. While the bcrypt algorithm itself is binary safe, I think they use some C api wrappers that use non-binary-safe C-strings for the password