Skip to content

Commit d313ad6

Browse files
mvorisekiluuu1994
authored andcommitted
1 parent a360b17 commit d313ad6

29 files changed

+56
-126
lines changed

UPGRADING

+3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ PHP 8.4 UPGRADE NOTES
4444
As such, passing invalid types to exit/die may now result in a TypeError
4545
being thrown.
4646
RFC: https://wiki.php.net/rfc/exit-as-function
47+
. The E_STRICT constant was deprecated and its corresponding error level was
48+
removed.
49+
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant
4750

4851
- DBA:
4952
. dba_open() and dba_popen() will now return a Dba\Connection

Zend/tests/ErrorException_getSeverity.phpt

-76
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

+3-3
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

+2-2
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/e_strict-deprecated.phpt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
The E_STRICT constant is deprecated
3+
--FILE--
4+
<?php
5+
6+
var_dump(E_ALL);
7+
var_dump(E_STRICT);
8+
9+
?>
10+
--EXPECTF--
11+
int(30719)
12+
13+
Deprecated: Constant E_STRICT is deprecated in %s on line %d
14+
int(2048)

Zend/tests/error_reporting01.phpt

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

-1
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,6 @@ static ZEND_COLD void get_filename_lineno(int type, zend_string **filename, uint
16041604
case E_COMPILE_WARNING:
16051605
case E_ERROR:
16061606
case E_NOTICE:
1607-
case E_STRICT:
16081607
case E_DEPRECATED:
16091608
case E_WARNING:
16101609
case E_USER_ERROR:

Zend/zend_constants.stub.php

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
/**
7272
* @var int
7373
* @cvalue E_STRICT
74+
* @deprecated
75+
* @todo Remove in PHP 9.0
7476
*/
7577
const E_STRICT = UNKNOWN;
7678

Zend/zend_constants_arginfo.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Zend/zend_errors.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define E_USER_ERROR (1<<8L)
3232
#define E_USER_WARNING (1<<9L)
3333
#define E_USER_NOTICE (1<<10L)
34+
// TODO: Remove in PHP 9.0
3435
#define E_STRICT (1<<11L)
3536
#define E_RECOVERABLE_ERROR (1<<12L)
3637
#define E_DEPRECATED (1<<13L)
@@ -39,7 +40,7 @@
3940
/* Indicates that this usually fatal error should not result in a bailout */
4041
#define E_DONT_BAIL (1<<15L)
4142

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)
43+
#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)
4344
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
4445

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

ext/standard/tests/file/parse_ini_file_variation3.phpt

+1-1
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

+1-1
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

+5-5
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

-4
Original file line numberDiff line numberDiff line change
@@ -1369,10 +1369,6 @@ static ZEND_COLD void php_error_cb(int orig_type, zend_string *error_filename, c
13691369
error_type_str = "Notice";
13701370
syslog_type_int = LOG_NOTICE;
13711371
break;
1372-
case E_STRICT:
1373-
error_type_str = "Strict Standards";
1374-
syslog_type_int = LOG_INFO;
1375-
break;
13761372
case E_DEPRECATED:
13771373
case E_USER_DEPRECATED:
13781374
error_type_str = "Deprecated";

php.ini-development

+3-7
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
@@ -442,7 +442,7 @@ memory_limit = 128M
442442
; operators. The error level constants are below here for convenience as well as
443443
; some common settings and their meanings.
444444
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
445-
; those related to E_NOTICE and E_STRICT, which together cover best practices and
445+
; those related to E_NOTICE, which together cover best practices and
446446
; recommended coding standards in PHP. For performance reasons, this is the
447447
; recommend error reporting setting. Your production server shouldn't be wasting
448448
; resources complaining about best practices and coding standards. That's what
@@ -462,9 +462,6 @@ memory_limit = 128M
462462
; intentional (e.g., using an uninitialized variable and
463463
; relying on the fact it is automatically initialized to an
464464
; empty string)
465-
; E_STRICT - run-time notices, enable to have PHP suggest changes
466-
; to your code which will ensure the best interoperability
467-
; and forward compatibility of your code
468465
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
469466
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
470467
; initial startup
@@ -480,11 +477,10 @@ memory_limit = 128M
480477
; Common Values:
481478
; E_ALL (Show all errors, warnings and notices including coding standards.)
482479
; E_ALL & ~E_NOTICE (Show all errors, except for notices)
483-
; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
484480
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
485481
; Default Value: E_ALL
486482
; Development Value: E_ALL
487-
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
483+
; Production Value: E_ALL & ~E_DEPRECATED
488484
; https://php.net/error-reporting
489485
error_reporting = E_ALL
490486

0 commit comments

Comments
 (0)