https://www.php.net/manual/en/migration80.incompatible.php

Under the "String to Number Comparison" section of the migration guide, there's no mention of explicit casts being unaffected. Using an explicit cast should be the general recommendation anyway. That is, anyone doing this:

42 == "42foo"

Should be doing an explicit cast before the comparison:

42 == (int)"42foo"

So as to avoid the issue altogether.



"match is now a reserved keyword."

No mention of variables named $match. Assigning the result of preg_match() to a variable named $match is pretty common. Linking "reserved keyword" to the page with the list of reserved keywords and/or reminding the reader that variables named $match are unaffected would be helpful.



"The needle argument for strpos(), strrpos(), stripos(), strripos(), strstr(), stristr() and strrchr() can now be empty."

I fail to see how this change is useful/correct. In my experience, passing in an empty string for the needle to any of those functions has always been part of a more critical application bug.

I'm also not sure why this is in the "Incompatible Changes" page of the migration documentation.

--
Thomas Hruska
CubicleSoft President

CubicleSoft has over 80 original open source projects and counting.
Plus a couple of commercial/retail products.

What software are you looking to build?

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to