error-reporting

What is the recommended error_reporting() setting for development? What about E_STRICT?

早过忘川 提交于 2019-12-17 16:25:03
问题 Typically I use E_ALL to see anything that PHP might say about my code to try and improve it. I just noticed a error constant E_STRICT , but have never used or heard about it, is this a good setting to use for development? The manual says: Run-time notices. Enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code. So I'm wondering if I'm using the best error_reporting level with E_ALL or would that along with E_STRICT

How to avoid isset() and empty()

穿精又带淫゛_ 提交于 2019-12-17 01:35:48
问题 I have several older applications that throw a lot of "xyz is undefined" and "undefined offset" messages when running on the E_NOTICE error level, because the existence of variables is not explicitly checked using isset() and consorts. I am considering working through them to make them E_NOTICE compatible, as notices about missing variables or offsets can be lifesavers, there may be some minor performance improvements to be gained, and it's overall the cleaner way. However, I don't like what

Add extra information to uncaught exception

若如初见. 提交于 2019-12-13 04:42:28
问题 In Google.Play there is a statistic about uncaught exceptions. I would like to know is there any way to add some extra information to exception, so it will be shown in Google.Play (cause third party error reporting services can't be used). I know about Thread.setUncaughtExceptionHandler and I suppose I can write something like public void uncaughtException (Thread thread, Throwable ex) { throw new CustomException(ex, "extraData"); } with my custom exception message for example. But are there

PHP not displaying any errors

南笙酒味 提交于 2019-12-12 15:45:23
问题 I know this has been asked multiple times in the past but none of the solutions worked for me. This is my PHP code: <?php function ?> This should produce an error. However, it's just returning a 500 error and not loading. I tried less severe error producing code like this: <?php $test = $example; ?> Calling on an undefined variable produced an error on a different computer. In my php.ini , I have display_errors = On , display_startup_errors = On , and error_reporting = E_ALL . Edit Thanks to

How to avoid isset() and empty()

*爱你&永不变心* 提交于 2019-12-12 06:36:16
问题 I have several older applications that throw a lot of "xyz is undefined" and "undefined offset" messages when running on the E_NOTICE error level, because the existence of variables is not explicitly checked using isset() and consorts. I am considering working through them to make them E_NOTICE compatible, as notices about missing variables or offsets can be lifesavers, there may be some minor performance improvements to be gained, and it's overall the cleaner way. However, I don't like what

PHP errors are not shown

倖福魔咒の 提交于 2019-12-12 01:01:26
问题 I've got an PHP file with an error in it, but I don't know where it is and there is no error reporting, but I enabled error reporting in php.ini and in the script. Why can't I see the error? 回答1: Make the first four lines of your page look like this: <?php error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); This will override your error echoing settings elsewhere so you can track down your problem. And of course, don't forget to do a phpinfo(); if

PHP Deprecated errors won't disappear on WordPress Dashboard

做~自己de王妃 提交于 2019-12-11 08:23:37
问题 TL;DR : Upgraded PHP on our server which caused a bunch of Deprecated errors to appear in WordPress, tried a number of fixes but the errors won't go away. PHP Version: 5.3.10 WordPress Version: 3.3.2 I have a WordPress installation that has been up and running for a little while now, with no complaint. This week, we upgraded PHP on the server to 5.3.10, after the update, the WordPress Dashboard began filling up with errors like this: Deprecated: Assigning the return value of new by reference

Error Reporting in WCF Service?

天大地大妈咪最大 提交于 2019-12-11 07:31:51
问题 I have a self hosted Net Tcp WCF service and I have the following method Subscribtion GetSubscribtion(int subscribtionId) { Subscribtion s; if (_subscribtionTable.TryGetValue(subscribtionId, out s) == false) { Console.WriteLine("Not Found SessionID");//for debugging throw new ArgumentException("Invalid Subscription Id"); } return s; } Is throwing exception is a good practice for reporting erros in service programming? 回答1: In WCF you should instead be defining and throwing a FaultException.

Can't disable error reporting in OpenCart (PHP)

自古美人都是妖i 提交于 2019-12-09 04:55:07
问题 I can't seem to disable error reporting in PHP - I have tried everything but "Notice" errors are still displayed. My php.ini has display_errors = Off; error_reporting = 0; My .htaccess has php_value error_reporting 0 And my script has ini_set('display_errors', 'Off'); ini_set('log_errors', 1); ini_set('error_reporting', 0); ini_set('display_startup_errors', 'Off'); php_info(); echo $my_undefined_var; The php_info() output confirms that display_errors and error_reporting are indeed off and 0,

how to enable error reporting in laravel 4.2 for debugging

陌路散爱 提交于 2019-12-08 20:48:21
问题 I just have installed new laravel 4.2 using composer . I make syntax mistake deliberately on my router.php to see if an appropriate exception is thrown by the application on my browser screen, but instead a got this Whoops, looks like something went wrong . i have checked the app/config.ph p file and changed "debug" = false to "debug" = true and it is not worked for me. Still I am getting the same message. does any body know how to configure laravel 4 to display error message on my screen?