Error message is blocked when parsing errors

I'll start by writing that I saw similar questions, and I tried the suggested solutions.

I run cli, when I intentionally put a parsing error in a php file, I don't get errors in stdOut.
I use the following configurations:
22527 for error_reporting -  ini_set('error_reporting', E_ALL|E_STRICT);

PHP 5.5.20 (cli) (built: Jan  9 2015 11:20:56) 
php -i | grep error 
display_errors => STDOUT => STDOUT
display_startup_errors => Off => Off
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 22527 => 22527
html_errors => Off => Off
ignore_repeated_errors => Off => Off
log_errors => Off => Off
log_errors_max_len => 1024 => 1024
track_errors => Off => Off
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off

ADDITION: if I add my own death handler:

    function fatal_handler() {
        $error = error_get_last();
        if ($error !== null) {
            echo ("\n\nERROR occured!\nFile [{$error['file']}].\nLine: [{$error['line']}].\nMessage: [{$error['message']}]\n\n");
        }
        exit(1);
    }
register_shutdown_function("fatal_handler");

I see an error in stdio.

Below is an example of code (with a parsing error) that doesn't generate errors for me

class A{
   const AAA = 'aaa';
   static public function Result(A::AAA){

   }
}
+4
source share
1 answer

error_reporting => 22527 => 22527equivalent to E_ALL & ~E_DEPRECATED & ~E_STRICT.

-1 E_ALL (E_ALL | E_STRICT PHP 5.4), .

ini php.ini.

error_reporting = -1

, , ini_set() .

<?php

ini_set('error_reporting', -1)

class A 
{
    const AAA = 'aaa';

    static public function Result(A::AAA) 
    {
    }
}
0

Source: https://habr.com/ru/post/1629034/


All Articles