Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
with:
configurationParameters: >-
--${{ matrix.debug && 'enable' || 'disable' }}-debug
${{ matrix.debug && 'CXXFLAGS="-D_GLIBCXX_ASSERTIONS"' || '' }}
--${{ matrix.zts && 'enable' || 'disable' }}-zts
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++' || '' }}
skipSlow: ${{ matrix.asan }}
Expand Down
6 changes: 6 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ PHP NEWS
triggers "Constant already defined" warning). (ilutov)
. Fixed bug GH-19476 (pipe operator fails to correctly handle returning
by reference). (alexandre-daubois)
. The report_memleaks INI directive has been deprecated. (alexandre-daubois)
. Constant redeclaration is deprecated and this behavior will trigger an
error in PHP 9. (alexandre-daubois)

- ODBC:
. Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley)
Expand All @@ -18,6 +21,9 @@ PHP NEWS
- Session:
. Added support for partitioned cookies. (nielsdos)

- SPL:
. Deprecate ArrayObject and ArrayIterator with objects. (Girgias)

- Standard:
. Fixed bug GH-16649 (UAF during array_splice). (alexandre-daubois)
. Passing integers outside the interval [0, 255] to chr() is now deprecated.
Expand Down
7 changes: 7 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ PHP 8.5 UPGRADE NOTES
. Returning null from __debugInfo() has been deprecated.
Return an empty array instead.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_debuginfo_returning_null
. The report_memleaks INI directive has been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_report_memleaks_ini_directive
. Constant redeclaration is deprecated and that behavior will trigger an
error in PHP 9.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_constant_redeclaration

- Curl:
. The curl_close() function has been deprecated, as CurlHandle objects are
Expand Down Expand Up @@ -421,6 +426,8 @@ PHP 8.5 UPGRADE NOTES
SplObjectStorage::offsetExists(), SplObjectStorage::offsetSet(), and
SplObjectStorage::offsetUnset() respectively.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_splobjectstoragecontains_splobjectstorageattach_and_splobjectstoragedetach
. Using ArrayObject and ArrayIterator with objects has been deprecated.
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects

- Standard:
. The socket_set_timeout() alias function has been deprecated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var_dump($reflection->getAttributes())

?>
--EXPECTF--
Warning: Constant MY_CONST already defined in %s on line %d
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
No attributes
array(0) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var_dump($reflection->getAttributes())

?>
--EXPECTF--
Warning: Constant MY_CONST already defined in %s on line %d
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
Has attributes (1)
array(1) {
[0]=>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var_dump($reflection->getAttributes())

?>
--EXPECTF--
Warning: Constant MY_CONST already defined in %s on line %d
Warning: Constant MY_CONST already defined, this will be an error in PHP 9 in %s on line %d
Has attributes
array(1) {
[0]=>
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug29890.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ define("TEST",3);

?>
--EXPECT--
error :Constant TEST already defined
error :Constant TEST already defined, this will be an error in PHP 9
4 changes: 2 additions & 2 deletions Zend/tests/constants/008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ echo "Done\n";
--EXPECTF--
TypeError: define(): Argument #1 ($constant_name) must be of type string, array given

Warning: Constant TRUE already defined in %s on line %d
Warning: Constant TRUE already defined, this will be an error in PHP 9 in %s on line %d
bool(false)
bool(true)
bool(true)
bool(true)

Warning: Constant test const already defined in %s on line %d
Warning: Constant test const already defined, this will be an error in PHP 9 in %s on line %d
bool(false)
bool(true)
bool(true)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/constants/constants_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var_dump(constant('1foo'));

?>
--EXPECTF--
Warning: Constant 1 already defined in %s on line %d
Warning: Constant 1 already defined, this will be an error in PHP 9 in %s on line %d
int(2)
int(2)
int(2)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/constants/constants_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ const foo = 2;

?>
--EXPECTF--
Warning: Constant foo\foo already defined in %s on line %d
Warning: Constant foo\foo already defined, this will be an error in PHP 9 in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/constants/constants_008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ if (defined('a')) {

?>
--EXPECTF--
Warning: Constant a already defined in %s on line %d
Warning: Constant a already defined, this will be an error in PHP 9 in %s on line %d
2
2 changes: 1 addition & 1 deletion Zend/tests/constants/halt_compiler/bug53305.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ var_dump(constant('__COMPILER_HALT_OFFSET__1'.chr(0)));

?>
--EXPECTF--
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
Warning: Constant __COMPILER_HALT_OFFSET__ already defined, this will be an error in PHP 9 in %s on line %d
int(1)
int(4)
2 changes: 1 addition & 1 deletion Zend/tests/constants/halt_compiler/halt_compiler3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ __HALT_COMPILER(); bad define() of __COMPILER_HALT_OFFSET__ 1
define ('__COMPILER_HALT_OFFSET__', 1);
?>
--EXPECTF--
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
Warning: Constant __COMPILER_HALT_OFFSET__ already defined, this will be an error in PHP 9 in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/constants/halt_compiler/halt_compiler4.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ __HALT_COMPILER();
?>
==DONE==
--EXPECTF--
Warning: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
Warning: Constant __COMPILER_HALT_OFFSET__ already defined, this will be an error in PHP 9 in %s on line %d
2 changes: 1 addition & 1 deletion Zend/zend_constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ ZEND_API zend_constant *zend_register_constant(zend_constant *c)
|| (!persistent && zend_get_special_const(ZSTR_VAL(name), ZSTR_LEN(name)))
|| (ret = zend_hash_add_constant(EG(zend_constants), name, c)) == NULL
) {
zend_error(E_WARNING, "Constant %s already defined", ZSTR_VAL(name));
zend_error(E_WARNING, "Constant %s already defined, this will be an error in PHP 9", ZSTR_VAL(name));
zend_string_release(c->name);
if (c->filename) {
zend_string_release(c->filename);
Expand Down
2 changes: 1 addition & 1 deletion build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6056,7 +6056,7 @@ function initPhpParser() {
}

$isInitialized = true;
$version = "5.6.0";
$version = "5.6.1";
$phpParserDir = __DIR__ . "/PHP-Parser-$version";
if (!is_dir($phpParserDir)) {
installPhpParser($version, $phpParserDir);
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/tests/bug71127.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ include($file);
@unlink(__DIR__ . "/bug71127.inc");
?>
--EXPECTF--
Warning: Constant FOO already defined in %sbug71127.inc on line %d
Warning: Constant FOO already defined, this will be an error in PHP 9 in %sbug71127.inc on line %d
okey
15 changes: 14 additions & 1 deletion main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,19 @@ static PHP_INI_MH(OnUpdateInputEncoding)
}
/* }}} */

static PHP_INI_MH(OnUpdateReportMemleaks)
{
bool *p = (bool *) ZEND_INI_GET_ADDR();
bool new_bool_value = zend_ini_parse_bool(new_value);

if (!new_bool_value) {
php_error_docref(NULL, E_DEPRECATED, "Directive 'report_memleaks' is deprecated");
}

*p = new_bool_value;
return SUCCESS;
}

/* {{{ PHP_INI_MH */
static PHP_INI_MH(OnUpdateOutputEncoding)
{
Expand Down Expand Up @@ -801,7 +814,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("ignore_repeated_errors", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_errors, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("ignore_repeated_source", "0", PHP_INI_ALL, OnUpdateBool, ignore_repeated_source, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("report_memleaks", "1", PHP_INI_ALL, OnUpdateBool, report_memleaks, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("report_memleaks", "1", PHP_INI_ALL, OnUpdateReportMemleaks, report_memleaks, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("report_zend_debug", "0", PHP_INI_ALL, OnUpdateBool, report_zend_debug, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateLong, output_buffering, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("output_handler", NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals)
Expand Down
3 changes: 2 additions & 1 deletion php.ini-development
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,12 @@ ignore_repeated_errors = Off
; https://php.net/ignore-repeated-source
ignore_repeated_source = Off

; Use of this INI entry is deprecated, it will be removed in PHP 9.0.
; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This is only effective in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
; https://php.net/report-memleaks
report_memleaks = On
;report_memleaks = On

; This setting is off by default.
;report_zend_debug = 0
Expand Down
3 changes: 2 additions & 1 deletion php.ini-production
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,12 @@ ignore_repeated_errors = Off
; https://php.net/ignore-repeated-source
ignore_repeated_source = Off

; Use of this INI entry is deprecated, it will be removed in PHP 9.0.
; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This is only effective in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
; https://php.net/report-memleaks
report_memleaks = On
;report_memleaks = On

; This setting is off by default.
;report_zend_debug = 0
Expand Down
1 change: 0 additions & 1 deletion run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ function main(): void
'log_errors=0',
'html_errors=0',
'track_errors=0',
'report_memleaks=1',
'report_zend_debug=0',
'docref_root=',
'docref_ext=.html',
Expand Down
11 changes: 11 additions & 0 deletions tests/basic/ini_directive_deprecated_report_memleaks.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--TEST--
Deprecated INI directive report_memleaks warning
--INI--
report_memleaks=0
--FILE--
<?php
echo "Testing deprecated report_memleaks INI directive.\n";
?>
--EXPECT--
Deprecated: PHP Startup: Directive 'report_memleaks' is deprecated in Unknown on line 0
Testing deprecated report_memleaks INI directive.