0

I am using this code to show syntax errors in php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

It works well but as soon as I start working with classes, errors don't show anymore for some classes (the core classes included in my index.php). I don't know why but they are still displayed in the action of the controller.

Anybody has an idea of what's going on and how to solve this problem without changing the php.ini ?

Thanks!!

tereško
  • 58,060
  • 25
  • 98
  • 150
gealex
  • 115
  • 9
  • You can't enable error_reporting this way in a file that already contains syntax errors. – mario Feb 19 '15 at 11:58
  • Thanks for you answer but i still don't get it. Why am i still able to get syntax errors from the action (the view function) of my controller ? – gealex Feb 19 '15 at 13:14

1 Answers1

0

You can try following code but its working my case

error_reporting(E_ALL);
ini_set('display_errors', 'On');
Elby
  • 1,624
  • 3
  • 23
  • 42