🔥 Just Launched! Werra Premium Template for HyväSee it in Action

Magento 1 – PHP Fatal error: getAllOptions() on PHP 7.2

By Jignesh ParmarUpdated on May 22, 2025 3 min read

Ever faced an error that says,

PHP Fatal error: Declaration of Mage_Customer_Model_Customer_Attribute_Source_Website::getAllOptions() must be compatible with Mage_Eav_Model_Entity_Attribute_Source_Table::getAllOptions($withEmpty = true, $defaultValues = false) in /app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php on line 34

It looks something like this in Magento 1 store:

Magento 1 - PHP Fatal error: getAllOptions() on PHP7.2

The above PHP error usually occurs in Magento 1 store when upgrading to PHP 7.2. When this error occurs, you may not be able to open any customers in the admin dashboard.

Also, you may not be able to export customers from the backend when this php error occurs.

This post discusses the programmatic solution for this Magento 1 – PHP Fatal error: getAllOptions() on PHP7 .2.

Implement the steps shown below to resolve the error.

Solution for Magento 1 – PHP Fatal error: getAllOptions() on PHP 7.2:

app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php
app/code/core/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php
app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php
app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php
app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php

Copy these files to the local folder

So the paths will be created as follows:

app/code/local/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php
app/code/local/Mage/Customer/Model/Entity/Address/Attribute/Source/Country.php
app/code/local/Mage/Customer/Model/Customer/Attribute/Source/Group.php
app/code/local/Mage/Customer/Model/Customer/Attribute/Source/Website.php
app/code/local/Mage/Customer/Model/Customer/Attribute/Source/Store.php

In these five files, you’ll find a line that states:

public function getAllOptions()

Change the above line to

public function getAllOptions($withEmpty = true, $defaultValues = false)

That’s it.

Also, make sure to migrate to the latest Magento 2 store in order to avail the performance and security features offered by Magento 2.4.1

You can skip the tedious task and simply opt for Meetanshi’s Magento 2 Migration Service that will offer professional help in migrating your store to the latest Magento 2 version under the guidance of certified Magento developers!

Do share the post with Magento 1 developers via social media.

Thank you.

Jignesh Parmar Full Image
Article byJignesh Parmar

An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.