com php-src: Fix SplHeap::compare arginfo and tests: UPGRADING ext/spl/spl_heap.c ext/spl/tests/heap_isempty_variati on_001.phpt
ext/spl/tests/spl_heap_extract_pa rameter_error.phpt

From: Date: Fri, 08 Feb 2019 09:14:38 +0000
Subject: com php-src: Fix SplHeap::compare arginfo and tests: UPGRADING ext/spl/spl_heap.c ext/spl/tests/heap_isempty_variati on_001.phpt
ext/spl/tests/spl_heap_extract_pa rameter_error.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-104478@lists.php.net to get a copy of this message
Commit: 780bdcd80b92250e6b7b7a6e95ea05ea35a651a3 Author: Levi Morrison <levim@php.net> Mon, 26 Nov 2018 15:45:59 -0700 Committer: Nikita Popov <nikita.ppv@gmail.com> Fri, 8 Feb 2019 10:14:38 +0100 Parents: c4bed605e79a20cba261d288ab3d0ec991b4fd21 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=780bdcd80b92250e6b7b7a6e95ea05ea35a651a3 Log: Fix SplHeap::compare arginfo and tests Changed paths: M UPGRADING M ext/spl/spl_heap.c M ext/spl/tests/heap_isempty_variation_001.phpt M ext/spl/tests/spl_heap_extract_parameter_error.phpt Diff: diff --git a/UPGRADING b/UPGRADING index b7da98e..21f83905 100644 --- a/UPGRADING +++ b/UPGRADING @@ -104,6 +104,9 @@ PHP 8.0 UPGRADE NOTES - SPL: . SplFileObject::fgetss() has been removed. + . SplHeap::compare($a, $b) now specifies a method signature. Inheriting + classes implementing this method will now have to use a compatible + method signature. - Standard: . assert() will no longer evaluate string arguments, instead they will be diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index ebb6348..41ad782 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -1188,7 +1188,7 @@ static const zend_function_entry spl_funcs_SplHeap[] = { SPL_ME(SplHeap, valid, arginfo_splheap_void, ZEND_ACC_PUBLIC) SPL_ME(SplHeap, recoverFromCorruption, arginfo_splheap_void, ZEND_ACC_PUBLIC) SPL_ME(SplHeap, isCorrupted, arginfo_splheap_void, ZEND_ACC_PUBLIC) - ZEND_FENTRY(compare, NULL, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_ABSTRACT) + ZEND_FENTRY(compare, NULL, arginfo_heap_compare, ZEND_ACC_PROTECTED|ZEND_ACC_ABSTRACT) PHP_FE_END }; /* }}} */ diff --git a/ext/spl/tests/heap_isempty_variation_001.phpt b/ext/spl/tests/heap_isempty_variation_001.phpt index dac470f..6c09407 100644 --- a/ext/spl/tests/heap_isempty_variation_001.phpt +++ b/ext/spl/tests/heap_isempty_variation_001.phpt @@ -2,14 +2,14 @@ SPL: SplHeap: isEmpty argument variation. --FILE-- <?php -class SplHeap2 extends SplHeap{ - public function compare() { - return -parent::compare(); - } +class SplHeap2 extends SplHeap { + public function compare($a, $b) { + return -parent::compare($a, $b); + } } -$h = new SplHeap2; +$h = new SplHeap2(); $h->isEmpty(1); ?> --EXPECTF-- diff --git a/ext/spl/tests/spl_heap_extract_parameter_error.phpt b/ext/spl/tests/spl_heap_extract_parameter_error.phpt index aecd03d..08c1de3 100644 --- a/ext/spl/tests/spl_heap_extract_parameter_error.phpt +++ b/ext/spl/tests/spl_heap_extract_parameter_error.phpt @@ -8,7 +8,7 @@ TestFest London May 2009 class TestHeap extends SplHeap { - function compare() { + function compare($a, $b) { print "This shouldn't be printed"; } }

« previous php.cvs (#104478) next »