php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36770 BC broken for no good reason
Submitted: 2006-03-17 11:13 UTC Modified: 2006-03-17 12:36 UTC
From: tony at marston-home dot demon dot co dot uk Assigned:
Status: Wont fix Package: Arrays related
PHP Version: 5.1.2 OS: Windows XP
Private report: No CVE-ID: None
 [2006-03-17 11:13 UTC] tony at marston-home dot demon dot co dot uk
Description:
------------
I know that you're going to say that this is not a bug, as you have done with bug #25762, but I just want to make the point that, regardless of what it now says in the manual, as far as we in userland are concerned THIS IS A BUG! You have changed the way that it works when compared wih PHP 4, so you have broken backwards compatibility. And for what reason? To make the language more pure! This is not a good enough reason.

It is no good saying that all array funcions MUST have arguments of the correct type, as this goes against the PHP tradition of being a very user-friendly and forgiving language that would accept arguments of any type and do any type casting itself. You are now saying that it is the programmer's responsibiliy to cast each variable to the correct type before calling an PHP function.

Just suppose this argument was carried forward to every other function with PHP. How popular would you be then?

This type of unnecessary BC breakage is conributing tothe slow take-up of PHP 5 because it breaks too many existing scripts FOR ABSOLUTELY NO GOOD REASON.

I suggest you stop this "code purity" nonsense and make PHP work in the way that it has always worked - easy to use and forgiving.

Expected result:
----------------
I expect the behaviour in PHP 4 to bethe same in PHP 5.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-17 11:20 UTC] derick@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


This is a nice rant, but what change are you pointing at here?
 [2006-03-17 11:21 UTC] tony2001@php.net
Please use the bug system for reporting bugs only.
Complaints, opinions and proposals should go into appropriate mailing list.
 [2006-03-17 11:53 UTC] tony at marston-home dot demon dot co dot uk
bug #25762 refers to array_merge in PHP 5 not working if any of the arguments is NULL instead of being an empty array. In PHP 4 this would automatically be treated the same as an empty array, but in PHP 5 it is not, which forces the developer to add in extra code to do the type castng manually instead of it being done automatically within the function.

If it is possible for a function to perform automatic type casting on any of its arguments, like it is with most other PHP functions, then it should do so without forcing the programmer to take unnecessary action.

This worked as expected in PHP 4 but is now broken in PHP 5, and for no good reason.
 [2006-03-17 12:36 UTC] derick@php.net
We won't change that anymore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 10:01:29 2024 UTC