ID:               36770
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tony at marston-home dot demon dot co dot uk
-Status:           Open
+Status:           Wont fix
 Bug Type:         Arrays related
 Operating System: Windows XP
 PHP Version:      5.1.2
 New Comment:

We won't change that anymore.


Previous Comments:
------------------------------------------------------------------------

[2006-03-17 11:53:24] 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 11:21:11] [EMAIL PROTECTED]

Please use the bug system for reporting bugs only.
Complaints, opinions and proposals should go into appropriate mailing
list.

------------------------------------------------------------------------

[2006-03-17 11:20:14] [EMAIL PROTECTED]

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:13:27] 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.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36770&edit=1

Reply via email to