Skip to content

Commit 283cdfb

Browse files
committed
Remove E_STRICT constant/error level
1 parent 84022db commit 283cdfb

9 files changed

+9
-83
lines changed

Zend/tests/ErrorException_getSeverity.phpt

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,6 @@ try {
192192
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
193193
}
194194

195-
try {
196-
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT);
197-
} catch(ErrorException $e) {
198-
echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity();
199-
var_dump($e->getSeverity() === E_STRICT);
200-
var_dump($e->getMessage() === EXCEPTION_PARAM_MSG);
201-
var_dump($e->getCode() === 0);
202-
var_dump($e->getPrevious() === NULL);
203-
var_dump($e->getFile() === __FILE__);
204-
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
205-
}
206-
207195
try {
208196
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR);
209197
} catch(ErrorException $e) {
@@ -384,18 +372,6 @@ try {
384372
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
385373
}
386374

387-
try {
388-
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__);
389-
} catch(ErrorException $e) {
390-
echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity();
391-
var_dump($e->getSeverity() === E_STRICT);
392-
var_dump($e->getMessage() === EXCEPTION_PARAM_MSG);
393-
var_dump($e->getCode() === 0);
394-
var_dump($e->getPrevious() === NULL);
395-
var_dump($e->getFile() === __FILE__);
396-
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
397-
}
398-
399375
try {
400376
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR, __FILE__);
401377
} catch(ErrorException $e) {
@@ -576,18 +552,6 @@ try {
576552
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
577553
}
578554

579-
try {
580-
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__, __LINE__);
581-
} catch(ErrorException $e) {
582-
echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity();
583-
var_dump($e->getSeverity() === E_STRICT);
584-
var_dump($e->getMessage() === EXCEPTION_PARAM_MSG);
585-
var_dump($e->getCode() === 0);
586-
var_dump($e->getPrevious() === NULL);
587-
var_dump($e->getFile() === __FILE__);
588-
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
589-
}
590-
591555
try {
592556
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR, __FILE__, __LINE__);
593557
} catch(ErrorException $e) {
@@ -813,22 +777,6 @@ try {
813777
}
814778
}
815779

816-
try {
817-
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__, __LINE__, NULL);
818-
} catch(Exception $exceptionErr) {
819-
try {
820-
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_STRICT, __FILE__, __LINE__, $exceptionErr->getPrevious());
821-
} catch(ErrorException $e) {
822-
echo EXCEPTION_SEVERITY_ERROR_MSG . $e->getSeverity();
823-
var_dump($e->getSeverity() === E_STRICT);
824-
var_dump($e->getMessage() === EXCEPTION_PARAM_MSG);
825-
var_dump($e->getCode() === 0);
826-
var_dump($e->getPrevious() === NULL);
827-
var_dump($e->getFile() === __FILE__);
828-
var_dump($e->getTraceAsString() === EXCEPTION_TRACE_AS_STRING_MSG);
829-
}
830-
}
831-
832780
try {
833781
throw new ErrorException(EXCEPTION_PARAM_MSG, EXCEPTION_CODE_ERROR, E_RECOVERABLE_ERROR, __FILE__, __LINE__, NULL);
834782
} catch(Exception $exceptionErr) {

Zend/zend.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,6 @@ static ZEND_COLD void get_filename_lineno(int type, zend_string **filename, uint
15541554
case E_COMPILE_WARNING:
15551555
case E_ERROR:
15561556
case E_NOTICE:
1557-
case E_STRICT:
15581557
case E_DEPRECATED:
15591558
case E_WARNING:
15601559
case E_USER_ERROR:

Zend/zend_constants.stub.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@
6868
*/
6969
const E_USER_NOTICE = UNKNOWN;
7070

71-
/**
72-
* @var int
73-
* @cvalue E_STRICT
74-
*/
75-
const E_STRICT = UNKNOWN;
76-
7771
/**
7872
* @var int
7973
* @cvalue E_RECOVERABLE_ERROR

Zend/zend_constants_arginfo.h

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Zend/zend_errors.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@
3131
#define E_USER_ERROR (1<<8L)
3232
#define E_USER_WARNING (1<<9L)
3333
#define E_USER_NOTICE (1<<10L)
34-
#define E_STRICT (1<<11L)
3534
#define E_RECOVERABLE_ERROR (1<<12L)
3635
#define E_DEPRECATED (1<<13L)
3736
#define E_USER_DEPRECATED (1<<14L)
3837

3938
/* Indicates that this usually fatal error should not result in a bailout */
4039
#define E_DONT_BAIL (1<<15L)
4140

42-
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)
41+
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED)
4342
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
4443

4544
/* Fatal errors that are ignored by the silence operator */

main/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,10 +1321,6 @@ static ZEND_COLD void php_error_cb(int orig_type, zend_string *error_filename, c
13211321
error_type_str = "Notice";
13221322
syslog_type_int = LOG_NOTICE;
13231323
break;
1324-
case E_STRICT:
1325-
error_type_str = "Strict Standards";
1326-
syslog_type_int = LOG_INFO;
1327-
break;
13281324
case E_DEPRECATED:
13291325
case E_USER_DEPRECATED:
13301326
error_type_str = "Deprecated";

php.ini-development

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
; error_reporting
108108
; Default Value: E_ALL
109109
; Development Value: E_ALL
110-
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
110+
; Production Value: E_ALL & ~E_DEPRECATED
111111

112112
; log_errors
113113
; Default Value: Off
@@ -452,7 +452,7 @@ memory_limit = 128M
452452
; operators. The error level constants are below here for convenience as well as
453453
; some common settings and their meanings.
454454
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
455-
; those related to E_NOTICE and E_STRICT, which together cover best practices and
455+
; those related to E_NOTICE, which together cover best practices and
456456
; recommended coding standards in PHP. For performance reasons, this is the
457457
; recommend error reporting setting. Your production server shouldn't be wasting
458458
; resources complaining about best practices and coding standards. That's what
@@ -472,9 +472,6 @@ memory_limit = 128M
472472
; intentional (e.g., using an uninitialized variable and
473473
; relying on the fact it is automatically initialized to an
474474
; empty string)
475-
; E_STRICT - run-time notices, enable to have PHP suggest changes
476-
; to your code which will ensure the best interoperability
477-
; and forward compatibility of your code
478475
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
479476
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
480477
; initial startup
@@ -490,11 +487,10 @@ memory_limit = 128M
490487
; Common Values:
491488
; E_ALL (Show all errors, warnings and notices including coding standards.)
492489
; E_ALL & ~E_NOTICE (Show all errors, except for notices)
493-
; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
494490
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
495491
; Default Value: E_ALL
496492
; Development Value: E_ALL
497-
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
493+
; Production Value: E_ALL & ~E_DEPRECATED
498494
; https://php.net/error-reporting
499495
error_reporting = E_ALL
500496

php.ini-production

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
; error_reporting
108108
; Default Value: E_ALL
109109
; Development Value: E_ALL
110-
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
110+
; Production Value: E_ALL & ~E_DEPRECATED
111111

112112
; log_errors
113113
; Default Value: Off
@@ -454,7 +454,7 @@ memory_limit = 128M
454454
; operators. The error level constants are below here for convenience as well as
455455
; some common settings and their meanings.
456456
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
457-
; those related to E_NOTICE and E_STRICT, which together cover best practices and
457+
; those related to E_NOTICE, which together cover best practices and
458458
; recommended coding standards in PHP. For performance reasons, this is the
459459
; recommend error reporting setting. Your production server shouldn't be wasting
460460
; resources complaining about best practices and coding standards. That's what
@@ -474,9 +474,6 @@ memory_limit = 128M
474474
; intentional (e.g., using an uninitialized variable and
475475
; relying on the fact it is automatically initialized to an
476476
; empty string)
477-
; E_STRICT - run-time notices, enable to have PHP suggest changes
478-
; to your code which will ensure the best interoperability
479-
; and forward compatibility of your code
480477
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
481478
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
482479
; initial startup
@@ -492,13 +489,12 @@ memory_limit = 128M
492489
; Common Values:
493490
; E_ALL (Show all errors, warnings and notices including coding standards.)
494491
; E_ALL & ~E_NOTICE (Show all errors, except for notices)
495-
; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
496492
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
497493
; Default Value: E_ALL
498494
; Development Value: E_ALL
499-
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
495+
; Production Value: E_ALL & ~E_DEPRECATED
500496
; https://php.net/error-reporting
501-
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
497+
error_reporting = E_ALL & ~E_DEPRECATED
502498

503499
; This directive controls whether or not and where PHP will output errors,
504500
; notices and warnings too. Error output is very useful during development, but

run-tests.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,6 @@ function run_all_tests_parallel(array $test_files, array $env, ?string $redir_te
16061606
'E_USER_ERROR',
16071607
'E_USER_WARNING',
16081608
'E_USER_NOTICE',
1609-
'E_STRICT', // TODO Cleanup when removed from Zend Engine.
16101609
'E_RECOVERABLE_ERROR',
16111610
'E_DEPRECATED',
16121611
'E_USER_DEPRECATED'

0 commit comments

Comments
 (0)