[RFC] deprecate PDO::PARAM_NULL

php.internals

Adam Baratz

9 years ago
Hi, I've heard a few people here mention that this type isn't useful. It looks like it wouldn't be harmful to remove. The RFC mainly outlines the impact and proposes a schedule for doing so. https://wiki.php.net/rfc/deprecate_pdo_null Please let me know your thoughts. Thanks, Adam

Matteo Beccati

9 years ago
Hi Adam, On 15/05/2017 13:49, Adam Baratz wrote:
> I've heard a few people here mention that this type isn't useful. It looks > like it wouldn't be harmful to remove. The RFC mainly outlines the impact > and proposes a schedule for doing so. > > https://wiki.php.net/rfc/deprecate_pdo_null > > Please let me know your thoughts.
Please elaborate: "A handful of people on the internals mail list have asked for it to be removed" - where and when? "Supporting it adds some weight to PDO" what kind of weight? How many lines / microseconds are we going to save? I would agree that NULL is not a type and the constant shouldn't have been there in the first place, but I think it could be a bit too late now. The proposal itself is rather evil: it would break lots of code (a quick github search shows 95k+ results) for basically no gain. Or maybe I just didn't get it. Cheers
-- Matteo Beccati Development & Consulting - http://www.beccati.com/

Adam Baratz

9 years ago
> > "A handful of people on the internals mail list have asked for it to be > removed" - where and when? >
I didn't mean this as a justification or as any kind of vote, just as a prompt for a formal discussion. "Supporting it adds some weight to PDO" what kind of weight? How many
> lines / microseconds are we going to save? >
It would mostly make some of the driver code easier to follow. There's some slightly strange logic in places, to account for being able to bind NULL by type or value. There are 14 references to PDO_PARAM_NULL across pdo, pdo_mysql, and pdo_pgsql. There are 6 references to the type in unit tests. I would agree that NULL is not a type and the constant shouldn't have
> been there in the first place, but I think it could be a bit too late now. > > The proposal itself is rather evil: it would break lots of code (a quick > github search shows 95k+ results) for basically no gain. Or maybe I just > didn't get it.
People could future-proof their code with PDO as it exists today. I'd want to deprecate it with the same schedule we've used to remove whole extensions. Is there a schedule that would make you comfortable with the change? Most of the gain would be in cleaning up the PDO type system. The more it resembles the SQL type system, the easier it will be for statements to be portable between drivers. Having a NULL type just feels like an anomaly that should be corrected. In all honesty, I'm ambivalent about this issue. It's certainly not causing any problems. But if enough people feel it should be removed, I'm happy to do the work to remove it. Thanks, Adam

Matteo Beccati

9 years ago
On 18/05/2017 12:16, Adam Baratz wrote:
> In all honesty, I'm ambivalent about this issue. It's certainly not > causing any problems. But if enough people feel it should be removed, > I'm happy to do the work to remove it.
Sure, cleaning it up would be cool. I am just slightly worried about its usage in the wild, i.e. I don't know how many ORMs, abstraction libraries, etc are using the feature and could suddenly break or just throw deprecation notices all the time. Cheers
-- Matteo Beccati Development & Consulting - http://www.beccati.com/