#16378 closed defect (bug) (fixed)
Use of array_intersect_key() breaks PHP4 compat
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Warnings/Notices | Keywords: | has-patch |
Focuses: | Cc: |
Description
Introduced in [17297], use of this function breaks PHP4 compatibility.
Attachments (2)
Change History (12)
#1
@
14 years ago
- Keywords has-patch added
The difference caused by changing to array_intersect_assoc is that you couldn't change the title of the action via the filter, if this is tried then that action is also removed from the dropdown.
#2
@
14 years ago
The only difference between 'array_intersect_key' and 'array_intersect_assoc' is when an array item is not 'key => value' but is instead only 'value'.
What's in core now:
http://www.php.net/manual/en/function.array-intersect-key.php
What's proposed:
http://www.php.net/manual/en/function.array-intersect-assoc.php
Another possible alternative is array_intersect:
http://www.php.net/manual/en/function.array-intersect.php
Array intersect seems like it could work too, since the _actions should match exactly if the intent is to potentially remove them.
#3
@
14 years ago
I deliberately chose array_intersect_key to allow modifying the labels. That could be done through gettext though.
#4
@
14 years ago
There are several different 4.0 compatible implementations of array_intersect_key on http://www.php.net/manual/en/function.array-intersect-key.php . Suggest just picking one of them that works and putting it in compat.php. Won't matter as of 3.2 anyway.
#5
@
14 years ago
I'd suggest that any time we need a compat function we check out the PHP_Compat pear package:
#6
@
14 years ago
Attached diff takes Sivel's suggestion and puts it into compat.php like Otto suggests.
#7
@
14 years ago
Leaning toward assoc. We're going to be dropping the no_new_actions thing once we clean up list tables in 3.2 anyway.
potentially replace with intersect_assoc