diff --git a/docs/release-process.md b/docs/release-process.md index 4c37d2b087390..eaaa8f76af8b3 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -6,6 +6,7 @@ repository available according to the release schedule. The release schedule for each version is published on the [PHP wiki](https://wiki.php.net): +- [PHP 8.4](https://wiki.php.net/todo/php84) - [PHP 8.3](https://wiki.php.net/todo/php83) - [PHP 8.2](https://wiki.php.net/todo/php82) - [PHP 8.1](https://wiki.php.net/todo/php81) diff --git a/ext/dom/tests/DOMElement_toggleAttribute.phpt b/ext/dom/tests/DOMElement_toggleAttribute.phpt index ed29be899dac2..b9e9989e1fe09 100644 --- a/ext/dom/tests/DOMElement_toggleAttribute.phpt +++ b/ext/dom/tests/DOMElement_toggleAttribute.phpt @@ -87,7 +87,7 @@ echo "Checking toggled namespace:\n"; var_dump($dom->documentElement->getAttribute('xmlns:anotheron')); ?> ---EXPECT-- +--EXPECTF-- Invalid Character Error --- Selected attribute tests (HTML) --- bool(false) @@ -95,10 +95,10 @@ bool(false) bool(true) - + bool(true) - + bool(false) diff --git a/ext/dom/tests/gh10234.phpt b/ext/dom/tests/gh10234.phpt index 5edc8fc6c1ff1..11d39cd625a79 100644 --- a/ext/dom/tests/gh10234.phpt +++ b/ext/dom/tests/gh10234.phpt @@ -55,7 +55,7 @@ $document->documentElement->textContent = "quote 'test'"; var_dump($document->documentElement->textContent); var_dump($document->saveHTML()); ?> ---EXPECT-- +--EXPECTF-- -- Attribute tests -- string(38) " " @@ -67,10 +67,10 @@ string(13) "hello & world" string(50) " " string(9) "hi" -string(54) " +string(%d) "hi<\/b>")%r> " string(12) "quote "test"" -string(45) " +string(%d) " " string(12) "quote 'test'" string(45) " diff --git a/ext/fileinfo/tests/bug79756.phpt b/ext/fileinfo/tests/bug79756.phpt index b4ea28baaa9b2..ad5478b62de8e 100644 --- a/ext/fileinfo/tests/bug79756.phpt +++ b/ext/fileinfo/tests/bug79756.phpt @@ -7,7 +7,6 @@ fileinfo $filename = __DIR__ . '/bug79756.xls'; $finfo = finfo_open(FILEINFO_MIME); $mime = finfo_file($finfo, $filename); -finfo_close($finfo); echo $mime; ?> --EXPECT-- diff --git a/ext/fileinfo/tests/cve-2014-1943-mb.phpt b/ext/fileinfo/tests/cve-2014-1943-mb.phpt index 9dd4a9ec18a5a..01cf70b811bea 100644 --- a/ext/fileinfo/tests/cve-2014-1943-mb.phpt +++ b/ext/fileinfo/tests/cve-2014-1943-mb.phpt @@ -15,13 +15,11 @@ $m = "0 byte x\n". file_put_contents($fd, $a); $fi = finfo_open(FILEINFO_NONE); var_dump(finfo_file($fi, $fd)); -finfo_close($fi); file_put_contents($fd, $b); file_put_contents($fm, $m); $fi = finfo_open(FILEINFO_NONE, $fm); var_dump(finfo_file($fi, $fd)); -finfo_close($fi); ?> Done --CLEAN-- diff --git a/ext/fileinfo/tests/cve-2014-1943.phpt b/ext/fileinfo/tests/cve-2014-1943.phpt index 35f66148ae79c..1aee196d16ffc 100644 --- a/ext/fileinfo/tests/cve-2014-1943.phpt +++ b/ext/fileinfo/tests/cve-2014-1943.phpt @@ -15,13 +15,11 @@ $m = "0 byte x\n". file_put_contents($fd, $a); $fi = finfo_open(FILEINFO_NONE); var_dump(finfo_file($fi, $fd)); -finfo_close($fi); file_put_contents($fd, $b); file_put_contents($fm, $m); $fi = finfo_open(FILEINFO_NONE, $fm); var_dump(finfo_file($fi, $fd)); -finfo_close($fi); ?> Done --CLEAN-- diff --git a/ext/fileinfo/tests/cve-2014-3538-mb.phpt b/ext/fileinfo/tests/cve-2014-3538-mb.phpt index e6c63e35ac852..3b158a26b7264 100644 --- a/ext/fileinfo/tests/cve-2014-3538-mb.phpt +++ b/ext/fileinfo/tests/cve-2014-3538-mb.phpt @@ -19,7 +19,6 @@ $fi = finfo_open(FILEINFO_NONE); $t = microtime(true); var_dump(finfo_file($fi, $fd)); $t = microtime(true) - $t; -finfo_close($fi); if ($t < 3) { echo "Ok\n"; } else { diff --git a/ext/fileinfo/tests/cve-2014-3538-nojit.phpt b/ext/fileinfo/tests/cve-2014-3538-nojit.phpt index 2010d538da951..73ecd09561d84 100644 --- a/ext/fileinfo/tests/cve-2014-3538-nojit.phpt +++ b/ext/fileinfo/tests/cve-2014-3538-nojit.phpt @@ -23,7 +23,6 @@ $fi = finfo_open(FILEINFO_NONE); $t = microtime(true); var_dump(finfo_file($fi, $fd)); $t = microtime(true) - $t; -finfo_close($fi); if ($t < 1.5) { echo "Ok\n"; } else { diff --git a/ext/fileinfo/tests/cve-2014-3538.phpt b/ext/fileinfo/tests/cve-2014-3538.phpt index f15e745fc05d3..d19278d1dc325 100644 --- a/ext/fileinfo/tests/cve-2014-3538.phpt +++ b/ext/fileinfo/tests/cve-2014-3538.phpt @@ -19,7 +19,6 @@ $fi = finfo_open(FILEINFO_NONE); $t = microtime(true); var_dump(finfo_file($fi, $fd)); $t = microtime(true) - $t; -finfo_close($fi); if ($t < 1.5) { echo "Ok\n"; } else { diff --git a/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt b/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt index 7426c909d9763..0ed6d48c803cb 100644 --- a/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt +++ b/ext/fileinfo/tests/finfo_buffer_basic-mb.phpt @@ -27,7 +27,6 @@ foreach( $options as $option ) { foreach( $buffers as $string ) { var_dump( finfo_buffer( $finfo, $string, $option ) ); } - finfo_close( $finfo ); } ?> diff --git a/ext/fileinfo/tests/finfo_buffer_basic.phpt b/ext/fileinfo/tests/finfo_buffer_basic.phpt index e338583fab702..6a6e6a7a862cb 100644 --- a/ext/fileinfo/tests/finfo_buffer_basic.phpt +++ b/ext/fileinfo/tests/finfo_buffer_basic.phpt @@ -27,7 +27,6 @@ foreach( $options as $option ) { foreach( $buffers as $string ) { var_dump( finfo_buffer( $finfo, $string, $option ) ); } - finfo_close( $finfo ); } ?> diff --git a/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt b/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt index f366972b613e1..a4d723f86c9ca 100644 --- a/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt +++ b/ext/fileinfo/tests/finfo_set_flags_basic-mb.phpt @@ -12,8 +12,6 @@ echo "*** Testing finfo_set_flags() : basic functionality ***\n"; var_dump( finfo_set_flags( $finfo, FILEINFO_NONE ) ); var_dump( finfo_set_flags( $finfo, FILEINFO_SYMLINK ) ); -finfo_close( $finfo ); - // OO way $finfo = new finfo( FILEINFO_NONE, $magicFile ); var_dump( $finfo->set_flags( FILEINFO_MIME ) ); diff --git a/ext/fileinfo/tests/finfo_set_flags_basic.phpt b/ext/fileinfo/tests/finfo_set_flags_basic.phpt index 948031a0b8006..db71447ae2393 100644 --- a/ext/fileinfo/tests/finfo_set_flags_basic.phpt +++ b/ext/fileinfo/tests/finfo_set_flags_basic.phpt @@ -12,8 +12,6 @@ echo "*** Testing finfo_set_flags() : basic functionality ***\n"; var_dump( finfo_set_flags( $finfo, FILEINFO_NONE ) ); var_dump( finfo_set_flags( $finfo, FILEINFO_SYMLINK ) ); -finfo_close( $finfo ); - // OO way $finfo = new finfo( FILEINFO_NONE, $magicFile ); var_dump( $finfo->set_flags( FILEINFO_MIME ) ); diff --git a/ext/fileinfo/tests/finfo_upstream.phpt b/ext/fileinfo/tests/finfo_upstream.phpt index ef5ec17b03706..2a28bd7f776c0 100644 --- a/ext/fileinfo/tests/finfo_upstream.phpt +++ b/ext/fileinfo/tests/finfo_upstream.phpt @@ -18,7 +18,6 @@ foreach($lst as $p) { if ($i !== $exp) { echo "'$p' failed\nexp: '$exp'\ngot: '$i'\n"; } - finfo_close($finfo); } echo "==DONE=="; diff --git a/ext/xml/compat.c b/ext/xml/compat.c index d338c7d17b9c4..cafb19c2c1edd 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -689,20 +689,8 @@ XML_GetCurrentColumnNumber(XML_Parser parser) PHP_XML_API long XML_GetCurrentByteIndex(XML_Parser parser) { - /* We have to temporarily disable the encoder to satisfy the note from the manual: - * "This function returns byte index according to UTF-8 encoded text disregarding if input is in another encoding." - * Although that should probably be corrected at one point? (TODO) */ - xmlCharEncodingHandlerPtr encoder = NULL; - xmlParserInputPtr input = parser->parser->input; - if (input->buf) { - encoder = input->buf->encoder; - input->buf->encoder = NULL; - } - long result = xmlByteConsumed(parser->parser); - if (encoder) { - input->buf->encoder = encoder; - } - return result; + return parser->parser->input->consumed + + (parser->parser->input->cur - parser->parser->input->base); } PHP_XML_API int