I would like to see a single error when I am using an undefined variable, but it would be nice to avoid to see other E_NOTICE errors, is it possible ?
E_NOTICE: Report only undefined variables
250 Views Asked by sylvain1264 At
1
There are 1 best solutions below
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in ERROR-REPORTING
- Nginx + php5-fpm not displaying php errors but cli is showing errors
- Stylus - Cannot read property 'x' of undefined
- Report PHP errors in JSON format complying with the regular content-type
- Java Applications Error/Crash reporting
- E_NOTICE: Report only undefined variables
- Unwanted lines in rails console error reporting
- Custom error reporting: how to log down function arguments (and possibly locals) in an exception handler?
- Send the Acra report always
- Windows 10 Mobile Error reporting not available
- How to report a Java JDK bug: choose the subcategory
- PHP CLI System_Daemon and error_reporting options ignored?
- Using error_reporting() in Zen cart
- Can't enable error reporting in PHP within Chrome
- How to change error reporting level in Laravel 4?
- Can't get PHP errors to go to a log file (other than the Apache log)
Related Questions in E-NOTICES
- E_NOTICE: Report only undefined variables
- Disable specific notice in PHP
- Notice error while counting number occurrences
- E_NOTICE and Undefined index error with multidimensional arrays
- Set custom error levels in zend framework
- PHP error_reporting E_NOTICE turned off, now gives pop-up warning
- Is php notices influences to data size sending to nginx?
- Using arrays keys without quotes, how to fix it on big project?
- set_error_handler, How do I suppress E_NOTICE in php
- PHP notice suppression; only certain circumstances/methods
- Logging PHP notice errors
- ob_end_flush() failed to delete and flush buffer
- How to assign a closure's return value to a variable by-reference, even if the closure returns by-value?
- PHP - How can I write better code with E_NOTICES enabled?
- Is there any way to notice E_NOTICE in php code?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Officially I would recommend against doing this, as it is quite possible to write PHP code that generates no warnings or notices. Indeed that should be your goal - to eliminate all notices and warnings.
However, what you're asking would be possible to achieve using PHP's custom error handling via
set_error_handler(), which accepts a callback function to run when an error is issued.You would define the function to do string matching for
undefined indexandundefined variablein the error string$errstrcallback parameter. You are then in effect overriding PHP's normal error reporting system, and substituting your own. I would reiterate that I don't think this is a great solution.Note: The above is not automatically portable for languages other English. But if it is only for your own purposes or limited use, that's maybe not a problem.