[Fix How to] PHP 5 and array_merge errors
If you've upgraded to php 5 on your server you may have seen some of your plug-in's and add-ons throwing errors like this:
Quote:
The reason this came up is due to a change in the way array_merge works in php 5. Basically it will no longer accept anything but an array without throwing an error. Thankfully it's just an 'incorrect usage' error and our code still works as it should, it just throws an error now. The correct way to fix this is not using array merge with anything but arrays. However we already have a lot of code lying around doing things like this: PHP Code:
Just change your code so it looks like this: PHP Code:
|
If you do just this change? Will this script work for php4?
|
Yes, the fix is just type casting the value into the array, however, if you know that you are only adding other types of data on to the array, just use array_push() or $var[] = 'option1';
PHP Code:
|
this small fix helps :)
|
i have the same problem but with functions.php
this is my error: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5 i tried to look for the above things in fuctions.php but was unscusseful...maybe u can help me as well |
Quote:
|
im fn lost. this sh.it doesnt help when you cant find the stupid code at all. then what the hell is the option 1, 2, 3, 4???
|
I have the same problem as mystic10 i get the same error and the error is this (array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1259) : eval()'d code on line 5) and i dont know what i should do or what to do can you plz help me
|
Quote:
Try asking nicely for help, and add a please, and include full error messages and I'll try to help you. Yes I'm an ass hole, but only when provoked. I'm pretty friendly if you come at me with respect. Quote:
Open functions.php and locate that line, on it you'll find a line of code similar to this one: PHP Code:
Once you have the name of the hook location go into the plug-in manager in the admincp and find all plug-ins using that location. The code throwing the error is located in one of them. |
This is my error:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /index.php(537) : eval()'d code on line 119 I've found the plug-in causing the error. I opened it saw an array and did as instructed above, but still received the same error. Can anyone help me with this please? Here is the code within the plug-in: Code:
if($vbulletin->options['siteteam_active'] == 1) { |
All times are GMT. The time now is 04:11 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|