I recently ended up looking for a way to hook into the Laravel framework, the same way as what Artisan is doing but without a registered command. That was because of a requirement I had where I wanted to put a dynamically generated command which will give certain output to be processed from Laravel application.
This function is sued for setting the error reporting level at runtime. To completely disable error reporting, the value is ‘0’ zero. syntex:
int error_reporting ([ int $level ] )
Other kind of error reporting levels
1 E_ERROR // Fatal run-time errors.
2 E_WARNING // Run-time warnings (non-fatal errors).
4 E_PARSE // Compile-time parse errors.
8 E_NOTICE // Run-time notices.
16 E_CORE_ERROR // Fatal errors that occur during PHP's initial startup.
32 E_CORE_WARNING // Warnings (non-fatal errors) that occur during PHP's initial startup.
64 E_COMPILE_ERROR // Fatal compile-time errors.
128 E_COMPILE_WARNING // Compile-time warnings.
256 E_USER_ERROR // User-generated error message.
512 E_USER_WARNING // User-generated warning message.
1024 E_USER_NOTICE // User-generated notice message.
2048 E_STRICT // Enable to have PHP suggest changes to your code which will ensure the best practice.
4096 E_RECOVERABLE_ERROR // Catchable fatal error.
8192 E_DEPRECATED // Warnings about code that will not work in future versions.
16384 E_USER_DEPRECATED // User-generated warning message.
32767 E_ALL // All errors and warnings.
Using combinations of error levels Example:
// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
// Report all PHP errors (see changelog)
Link to this post!
PHP Data Objects (PDO) as an abstraction layer used for accessing databases. It makes life easier while working with databases oriented applications. There are several fetch modes available with the library which help us through the development and it would reduce a lot of custom coding if we know exactly how to use them. We […]
One of the common complex task among webdevelopers is image resizing. It is a big headach when using multiple size images in multiple pages of a single version of image. For long I was using a an script that would create one thumnail version of the image when the image is uploaded. It was not […]
I wanted to run a SQL query against MySQL database server which contains search string and need to be formated using sprintf. The problem arise when format. It is because of the sign “%” am using to advance my search term. The query was…
$sql = "SELECT * FROM user WHERE country = '%s' AND fName LIKE '%s%' ORDER BY fName";
$sql = sprintf($sql, $country, $searchTerm);
Here where the error fires. Thanks God, I found the […]