View Full Version : Fatal error: Call to undefined function: array_combine()
Keithk
06-25-2010, 05:24 PM
My install went extremely well, everything was working fine. I decided to attempt a new module. Maybe I was clicking around too fast, not sure, but now my home page gives me this error, and I'm not sure how to correct it.
I deleted the module I created, it never worked, I was trying to add a Google Calendar in the center column.
Fatal error: Call to undefined function: array_combine() in /home/yaddy/public_html/forums/includes/vba_cmps_include_top.php on line 978
Keithk
06-25-2010, 10:03 PM
Follow up post.
I stumbled upon a fix for this issue, but want to bring this to the attention of the development team.
From what I read via google searches, the "array_combine" was meant for PHP v5. Some offered up new code so that it would be compatible on for those of us still running PHP v4. I didn't not experiment with any of the code change suggestions I saw because they did not pertain to vBa, but to other applications.
With that said, I went back through some of the changes I made in my Admin Control Panel. As it turns out, under EDIT PAGE, I had selected "Allow Page Customization" and changed it to "Yes". This is apparently what throws the fatal error because once I went back to select "No" (do not allow page customization", the error disappeared and my portal was back.
Brian
06-28-2010, 02:02 PM
Thank you for pointing this out. You should be able to correct the issue by looking in your includes/vba_cmps_include_top.php file for this code at the top:
error_reporting(E_ALL & ~E_NOTICE & ~8192);
And adding this just below:
// ##### array_combine() for PHP 4- ###########################################
if (!function_exists('array_combine'))
{
function array_combine($keys, $values)
{
if (sizeof($keys) != sizeof($values))
{
return false;
}
$array = array();
$key = 0;
foreach ($keys AS $keyvalue)
{
$array[$keyvalue] = $values[$key];
$key++;
}
return $array;
}
}
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.