array_merge change
The function “array_merge” is more flexible in PHP4 than in PHP5. In PHP4, it took a mixed set of arguments and returned an array. In PHP5, it will only take arrays.
In the following example, it doesn’t matter if $instructor is an array or a string in PHP4, you’ll still get an array back that combines the instructor and the students:
<? $students = array("Pat MacDonald", "Barbara McKenna", "Wally Ingram"); $class = array_merge($students, $instructor); ?>
In PHP5, you will need to ensure that all variables that you give to array_merge are arrays. Either make sure that you use arrays, or cast suspect variables as an array:
<? $students = array("Pat MacDonald", "Barbara McKenna", "Wally Ingram"); $class = array_merge($students, (array)$instructor); ?>
This is one you’ll need to be aware of if you have custom code on your pages, as it can fail without your knowledge; only after several days or weeks do you realize that one or more of your merged arrays is missing data.
