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
4 changes: 2 additions & 2 deletions .github/nightly_matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function get_current_version(): array {

$trigger = $argv[1] ?? 'schedule';
$attempt = (int) ($argv[2] ?? 1);
$monday = date('w', time()) === '1';
$discard_cache = $monday
$sunday = date('w', time()) === '0';
$discard_cache = $sunday
|| ($trigger === 'schedule' && $attempt !== 1)
|| $trigger === 'workflow_dispatch';
if ($discard_cache) {
Expand Down
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES
. CHECK_ZVAL_NULL_PATH() and CHECK_NULL_PATH() have been removed, use
zend_str_has_nul_byte(Z_STR_P(...)) and zend_char_has_nul_byte()
respectively.
. ZEND_LTOA() (and ZEND_LTOA_BUF_LEN) has been removed, as it was
unsafe. Directly use ZEND_LONG_FMT with a function from the
printf family.

========================
2. Build system changes
Expand Down
10 changes: 5 additions & 5 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -6393,6 +6393,11 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */
zend_ast *cond_ast = case_ast->child[0];
znode cond_node;

if (case_ast->attr == ZEND_ALT_CASE_SYNTAX) {
CG(zend_lineno) = case_ast->lineno;
zend_error(E_DEPRECATED, "Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead");
}

if (!cond_ast) {
if (has_default_case) {
CG(zend_lineno) = case_ast->lineno;
Expand All @@ -6403,11 +6408,6 @@ static void zend_compile_switch(zend_ast *ast) /* {{{ */
continue;
}

if (case_ast->attr == ZEND_ALT_CASE_SYNTAX) {
CG(zend_lineno) = case_ast->lineno;
zend_error(E_DEPRECATED, "Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead");
}

zend_compile_expr(&cond_node, cond_ast);

if (expr_node.op_type == IS_CONST
Expand Down
15 changes: 0 additions & 15 deletions Zend/zend_long.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,20 @@ typedef int32_t zend_off_t;
#endif


/* Conversion macros. */
#define ZEND_LTOA_BUF_LEN 65

#ifdef ZEND_ENABLE_ZVAL_LONG64
# define ZEND_LONG_FMT "%" PRId64
# define ZEND_ULONG_FMT "%" PRIu64
# define ZEND_XLONG_FMT "%" PRIx64
# define ZEND_LONG_FMT_SPEC PRId64
# define ZEND_ULONG_FMT_SPEC PRIu64
# ifdef ZEND_WIN32
# define ZEND_LTOA(i, s, len) _i64toa_s((i), (s), (len), 10)
# define ZEND_ATOL(s) _atoi64((s))
# define ZEND_STRTOL(s0, s1, base) _strtoi64((s0), (s1), (base))
# define ZEND_STRTOUL(s0, s1, base) _strtoui64((s0), (s1), (base))
# define ZEND_STRTOL_PTR _strtoi64
# define ZEND_STRTOUL_PTR _strtoui64
# define ZEND_ABS _abs64
# else
# define ZEND_LTOA(i, s, len) \
do { \
int st = snprintf((s), (len), ZEND_LONG_FMT, (i)); \
(s)[st] = '\0'; \
} while (0)
# define ZEND_ATOL(s) atoll((s))
# define ZEND_STRTOL(s0, s1, base) strtoll((s0), (s1), (base))
# define ZEND_STRTOUL(s0, s1, base) strtoull((s0), (s1), (base))
Expand All @@ -90,14 +81,8 @@ typedef int32_t zend_off_t;
# define ZEND_LONG_FMT_SPEC PRId32
# define ZEND_ULONG_FMT_SPEC PRIu32
# ifdef ZEND_WIN32
# define ZEND_LTOA(i, s, len) _ltoa_s((i), (s), (len), 10)
# define ZEND_ATOL(s) atol((s))
# else
# define ZEND_LTOA(i, s, len) \
do { \
int st = snprintf((s), (len), ZEND_LONG_FMT, (i)); \
(s)[st] = '\0'; \
} while (0)
# define ZEND_ATOL(s) atol((s))
# endif
# define ZEND_STRTOL_PTR strtol
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/hrtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
} while (0)
#endif
#define PHP_RETURN_HRTIME(t) do { \
char _a[ZEND_LTOA_BUF_LEN]; \
char _a[65]; \
double _d; \
HRTIME_U64A(t, _a, ZEND_LTOA_BUF_LEN); \
HRTIME_U64A(t, _a, sizeof(_a)); \
_d = zend_strtod(_a, NULL); \
RETURN_DOUBLE(_d); \
} while (0)
Expand Down
8 changes: 8 additions & 0 deletions ext/uri/uri_parser_rfc3986.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
#include "Zend/zend_smart_str.h"
#include "Zend/zend_exceptions.h"

#include <uriparser/Uri.h>

struct php_uri_parser_rfc3986_uris {
UriUriA uri;
UriUriA normalized_uri;
bool normalized_uri_initialized;
};

static void *php_uri_parser_rfc3986_memory_manager_malloc(UriMemoryManager *memory_manager, size_t size)
{
return emalloc(size);
Expand Down
7 changes: 1 addition & 6 deletions ext/uri/uri_parser_rfc3986.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
#ifndef PHP_URI_PARSER_RFC3986_H
#define PHP_URI_PARSER_RFC3986_H

#include <uriparser/Uri.h>
#include "php_uri_common.h"

extern const php_uri_parser php_uri_parser_rfc3986;

typedef struct php_uri_parser_rfc3986_uris {
UriUriA uri;
UriUriA normalized_uri;
bool normalized_uri_initialized;
} php_uri_parser_rfc3986_uris;
typedef struct php_uri_parser_rfc3986_uris php_uri_parser_rfc3986_uris;

zend_result php_uri_parser_rfc3986_userinfo_read(void *uri, php_uri_component_read_mode read_mode, zval *retval);
zend_result php_uri_parser_rfc3986_userinfo_write(void *uri, zval *value, zval *errors);
Expand Down
2 changes: 2 additions & 0 deletions tests/lang/033.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ switch ($a):
endswitch;
?>
--EXPECTF--
Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in %s

Deprecated: Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead in %s
If: 11
While: 12346789
Expand Down