Skip to content

Commit 0a7695c

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: PHP 8.5 | UPGRADING: fix entry about new grapheme $locale parameter (#20239) uri: Make uri_parser_rfc3986.h usable for external extensions (#20173) Fix missing deprecation message for default case statement followed by semicolon (#20172)
2 parents 1ef7abf + cea52f7 commit 0a7695c

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

Zend/zend_compile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6393,6 +6393,11 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */
63936393
zend_ast *cond_ast = case_ast->child[0];
63946394
znode cond_node;
63956395

6396+
if (case_ast->attr == ZEND_ALT_CASE_SYNTAX) {
6397+
CG(zend_lineno) = case_ast->lineno;
6398+
zend_error(E_DEPRECATED, "Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead");
6399+
}
6400+
63966401
if (!cond_ast) {
63976402
if (has_default_case) {
63986403
CG(zend_lineno) = case_ast->lineno;
@@ -6403,11 +6408,6 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */
64036408
continue;
64046409
}
64056410

6406-
if (case_ast->attr == ZEND_ALT_CASE_SYNTAX) {
6407-
CG(zend_lineno) = case_ast->lineno;
6408-
zend_error(E_DEPRECATED, "Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead");
6409-
}
6410-
64116411
zend_compile_expr(&cond_node, cond_ast);
64126412

64136413
if (expr_node.op_type == IS_CONST

ext/uri/uri_parser_rfc3986.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
#include "Zend/zend_smart_str.h"
2121
#include "Zend/zend_exceptions.h"
2222

23+
#include <uriparser/Uri.h>
24+
25+
struct php_uri_parser_rfc3986_uris {
26+
UriUriA uri;
27+
UriUriA normalized_uri;
28+
bool normalized_uri_initialized;
29+
};
30+
2331
static void *php_uri_parser_rfc3986_memory_manager_malloc(UriMemoryManager *memory_manager, size_t size)
2432
{
2533
return emalloc(size);

ext/uri/uri_parser_rfc3986.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@
1717
#ifndef PHP_URI_PARSER_RFC3986_H
1818
#define PHP_URI_PARSER_RFC3986_H
1919

20-
#include <uriparser/Uri.h>
2120
#include "php_uri_common.h"
2221

2322
extern const php_uri_parser php_uri_parser_rfc3986;
2423

25-
typedef struct php_uri_parser_rfc3986_uris {
26-
UriUriA uri;
27-
UriUriA normalized_uri;
28-
bool normalized_uri_initialized;
29-
} php_uri_parser_rfc3986_uris;
24+
typedef struct php_uri_parser_rfc3986_uris php_uri_parser_rfc3986_uris;
3025

3126
zend_result php_uri_parser_rfc3986_userinfo_read(void *uri, php_uri_component_read_mode read_mode, zval *retval);
3227
zend_result php_uri_parser_rfc3986_userinfo_write(void *uri, zval *value, zval *errors);

tests/lang/033.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ switch ($a):
3838
endswitch;
3939
?>
4040
--EXPECTF--
41+
Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in %s
42+
4143
Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in %s
4244
If: 11
4345
While: 12346789

0 commit comments

Comments
 (0)