1

I have installed Magento and PrestaShop on my local computer. I wrote 2 modules (for presta and magento and they have the same core). The problem is error_reporting. Let me give you an example. Magento

@ini_set('display_errors', 'on');
@error_reporting(E_ALL | E_STRICT);
$obj = new Obj();
var_dump($obj->version); //returns null because the property "version" doesn't really exist
die();

Presta

$obj = new Obj();
var_dump($obj->version); //returns E_NOTICE error because the property "version" doesn't really exist

Why Magento returns null while Presta throws error. What can cause such a behavior?

matiash
  • 53
  • 4

2 Answers2

2

php settings. if you have it set for showing E_NOTICE it will show the notice. The first probably "has" the notice as well, but you didn't set your system to show it

Please see this reference question for more information about errors

Community
  • 1
  • 1
Nanne
  • 64,065
  • 16
  • 119
  • 163
1

Errors can be handles and inside a framework there are checks in place that are assuring a certain quality of code. Your property may exist, but it may be not visible in a certain context - like private properties. In your Obj there may be an overloading function like __get() that handles the return in case values are not there or they don't correspond to some other logic.

Elzo Valugi
  • 27,240
  • 15
  • 95
  • 114