RE: [PHP-DEV] [RFC] Deprecate Fuzzy Type Casts and Allow Stringable in Strict Mode

From: Date: Mon, 26 Jan 2026 18:21:03 +0000
Subject: RE: [PHP-DEV] [RFC] Deprecate Fuzzy Type Casts and Allow Stringable in Strict Mode
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-129934@lists.php.net to get a copy of this message
> I'm afraid that deprecating and eventually erroring these casts will break a lot of hard > to trace legacy code, where a cast "solved" most problems, or at least did not crash > things. I'm talking about values that come from automated import systems, go through dozens of > layers of code that haven't been touched since php 5.2 or earlier, and eventually > end up in a part where we do a cast. It was also not unthinkable that these casts were used > _because_ it truncated the invalid parts, and while we could replace this with a preg_match to > extract the number, I don't particularly feel like going through nearly 5k int casts in this > codebase and figure out if it should change or not.  I share this exact same concern for the same reasons, particularly regarding the int cast. -Jeff

« previous php.internals (#129934) next »