Skip to content

Commit 45bef89

Browse files
committed
Remove E_STRICT constant/error level
1 parent da60d89 commit 45bef89

27 files changed

+35
-133
lines changed

Zend/tests/ErrorException_getSeverity.phpt

Lines changed: 0 additions & 76 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) {
@@ -953,12 +901,6 @@ bool(true)
953901
bool(true)
954902
bool(true)
955903
bool(true)
956-
This exception severity is: 2048bool(true)
957-
bool(true)
958-
bool(true)
959-
bool(true)
960-
bool(true)
961-
bool(true)
962904
This exception severity is: 4096bool(true)
963905
bool(true)
964906
bool(true)
@@ -1049,12 +991,6 @@ bool(true)
1049991
bool(true)
1050992
bool(true)
1051993
bool(true)
1052-
This exception severity is: 2048bool(true)
1053-
bool(true)
1054-
bool(true)
1055-
bool(true)
1056-
bool(true)
1057-
bool(true)
1058994
This exception severity is: 4096bool(true)
1059995
bool(true)
1060996
bool(true)
@@ -1145,12 +1081,6 @@ bool(true)
11451081
bool(true)
11461082
bool(true)
11471083
bool(true)
1148-
This exception severity is: 2048bool(true)
1149-
bool(true)
1150-
bool(true)
1151-
bool(true)
1152-
bool(true)
1153-
bool(true)
11541084
This exception severity is: 4096bool(true)
11551085
bool(true)
11561086
bool(true)
@@ -1241,12 +1171,6 @@ bool(true)
12411171
bool(true)
12421172
bool(true)
12431173
bool(true)
1244-
This exception severity is: 2048bool(true)
1245-
bool(true)
1246-
bool(true)
1247-
bool(true)
1248-
bool(true)
1249-
bool(true)
12501174
This exception severity is: 4096bool(true)
12511175
bool(true)
12521176
bool(true)

Zend/tests/bug33771.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var_dump(error_reporting());
3434
echo "Done\n";
3535
?>
3636
--EXPECT--
37-
int(32767)
38-
int(32767)
39-
int(32759)
37+
int(30719)
38+
int(30719)
39+
int(30711)
4040
Done

Zend/tests/bug81652.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ var_dump(error_reporting());
1818

1919
?>
2020
--EXPECT--
21-
int(32767)
22-
int(32767)
21+
int(30719)
22+
int(30719)

Zend/tests/error_reporting01.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ var_dump(error_reporting());
2222
echo "Done\n";
2323
?>
2424
--EXPECT--
25-
int(32767)
25+
int(30719)
2626
Done

Zend/tests/error_reporting02.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ var_dump(error_reporting());
2323
echo "Done\n";
2424
?>
2525
--EXPECT--
26-
int(32767)
26+
int(30719)
2727
Done

Zend/tests/error_reporting03.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ echo "Done\n";
3131
?>
3232
--EXPECTF--
3333
Warning: Undefined variable $undef2 in %s on line %d
34-
int(32767)
34+
int(30719)
3535
Done

Zend/tests/error_reporting04.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ echo "Done\n";
1919
?>
2020
--EXPECTF--
2121
Warning: Undefined variable $undef in %s on line %d
22-
int(32767)
22+
int(30719)
2323
Done

Zend/tests/error_reporting05.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ echo "Done\n";
3030
Warning: Undefined variable $undef_value in %s on line %d
3131

3232
Warning: Undefined variable $undef_name in %s on line %d
33-
int(32767)
33+
int(30719)
3434
Done

Zend/tests/error_reporting06.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ var_dump(error_reporting());
2626
echo "Done\n";
2727
?>
2828
--EXPECT--
29-
int(32767)
29+
int(30719)
3030
Done

Zend/tests/error_reporting07.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ var_dump(error_reporting());
2626
echo "Done\n";
2727
?>
2828
--EXPECT--
29-
int(32767)
29+
int(30719)
3030
Done

Zend/tests/error_reporting08.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ echo "Done\n";
2828
?>
2929
--EXPECTF--
3030
Warning: Undefined variable $undef3 in %s on line %d
31-
int(32767)
31+
int(30719)
3232
Done

Zend/tests/error_reporting09.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ echo "Done\n";
2727
Warning: Undefined variable $blah in %s on line %d
2828

2929
Warning: Undefined variable $undef2 in %s on line %d
30-
int(32767)
30+
int(30719)
3131
Done

Zend/tests/error_reporting10.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ var_dump(error_reporting());
2929
echo "Done\n";
3030
?>
3131
--EXPECT--
32-
int(32767)
33-
int(32759)
32+
int(30719)
33+
int(30711)
3434
Done

Zend/tests/throw/leaks.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ new stdClass(exit);
3131
Caught
3232
Caught
3333
Caught
34-
int(32767)
34+
int(30719)

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 */

ext/standard/tests/file/parse_ini_file_variation3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ foreach($newdirs as $newdir) {
7070
New include path is : %sparse_ini_file_variation3.dir1%sparse_ini_file_variation3.dir2%sparse_ini_file_variation3.dir3%S
7171
array(9) {
7272
["error_reporting"]=>
73-
string(5) "32767"
73+
string(5) "30719"
7474
["display_errors"]=>
7575
string(1) "1"
7676
["display_startup_errors"]=>

ext/standard/tests/general_functions/bug70157.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ array(%d) {
2121
["foo"]=>
2222
array(%d) {
2323
[123]=>
24-
int(24575)
24+
int(22527)
2525
[456]=>
2626
int(123)
2727
}

ext/standard/tests/general_functions/parse_ini_booleans.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ array(3) {
1515
["error_reporting values"]=>
1616
array(6) {
1717
["foo"]=>
18-
string(7) "32767 8"
18+
string(7) "30719 8"
1919
["error_reporting"]=>
20-
string(5) "32767"
20+
string(5) "30719"
2121
["error_reporting1"]=>
2222
string(4) "4177"
2323
["error_reporting2"]=>
24-
string(5) "32759"
24+
string(5) "30711"
2525
["error_reporting3"]=>
26-
string(5) "32759"
26+
string(5) "30711"
2727
["error_reporting4"]=>
28-
string(5) "32759"
28+
string(5) "30711"
2929
}
3030
["true or false"]=>
3131
array(8) {

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

0 commit comments

Comments
 (0)