Skip to content

Commit 0495b85

Browse files
committed
7.4 fixes
1 parent 4d2886a commit 0495b85

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

phper-sys/php_wrapper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ phper_zend_begin_arg_with_return_obj_info_ex(bool return_reference,
507507
bool allow_null) {
508508
#define static
509509
#define const
510-
#if PHP_VERSION_ID >= 70400
510+
#if PHP_VERSION_ID >= 80000
511511
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(info, return_reference, required_num_args, class_name, allow_null)
512512
#else
513513
ZEND_BEGIN_ARG_INFO_EX(info, 0, return_reference, required_num_args)
@@ -529,7 +529,7 @@ zend_internal_arg_info phper_zend_arg_info_with_type(bool pass_by_ref,
529529
uint32_t type_hint,
530530
bool allow_null,
531531
const char *default_value) {
532-
#if PHP_VERSION_ID >= 70400
532+
#if PHP_VERSION_ID >= 80000
533533
zend_internal_arg_info info[] = {
534534
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value)
535535
};
@@ -546,7 +546,7 @@ zend_internal_arg_info phper_zend_arg_obj_info(bool pass_by_ref,
546546
const char *name,
547547
const char *class_name,
548548
bool allow_null) {
549-
#if PHP_VERSION_ID >= 70400
549+
#if PHP_VERSION_ID >= 80000
550550
zend_internal_arg_info info[] = {
551551
ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, class_name, allow_null, NULL)
552552
};

tests/integration/tests/php/typehints.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858

5959
['testNull', 'null', true, true, '8.2'],
6060

61-
['testClassEntry', 'class_name', false, true, '7.4'],
62-
['testClassEntryOptional', 'class_name', false, false, '7.4'],
63-
['testClassEntryNullable', 'class_name', true, true, '7.4'],
61+
['testClassEntry', 'class_name', false, true, '8.0'],
62+
['testClassEntryOptional', 'class_name', false, false, '8.0'],
63+
['testClassEntryNullable', 'class_name', true, true, '8.0'],
6464
];
6565

6666
// typehints
@@ -110,11 +110,11 @@
110110
['returnCallableNullable', 'callable', true],
111111
['returnIterable', 'iterable', false],
112112
['returnIterableNullable', 'iterable', true],
113-
['returnMixed', 'mixed', true, '7.4'],
113+
['returnMixed', 'mixed', true, '8.0'],
114114
['returnNever', 'never', false, '8.1'],
115115
['returnVoid', 'void', false],
116-
['returnClassEntry', 'class_name', false, '7.4'],
117-
['returnClassEntryNullable', 'class_name', true, '7.4'],
116+
['returnClassEntry', 'class_name', false, '8.0'],
117+
['returnClassEntryNullable', 'class_name', true, '8.0'],
118118
];
119119
echo PHP_EOL . 'Testing return typehints' . PHP_EOL;
120120
$cls = new \IntegrationTest\TypeHints\ReturnTypeHintTest();
@@ -155,15 +155,15 @@ public function setValue($value): void {
155155

156156
$argumentDefaultValueProvider = [
157157
// <method>, <expected default value>, <(optional) min php version>
158-
['stringDefault', 'foobarbaz', 'string', '7.4'],
159-
['stringConstantDefault', PHP_VERSION, 'string', '7.4'],
160-
['boolDefaultTrue', true, 'boolean', '7.4'],
161-
['boolDefaultFalse', false, 'boolean', '7.4'],
162-
['intDefault', 42, 'integer', '7.4'],
163-
['floatDefault', 3.14159, 'double', '7.4'],
164-
['arrayDefault', ['a' => 'b'], 'array', '7.4'],
165-
['iterableDefault', [0 => 1], 'array', '7.4'],
166-
['mixedDefault', 999, 'integer', '7.4'],
158+
['stringDefault', 'foobarbaz', 'string', '8.0'],
159+
['stringConstantDefault', PHP_VERSION, 'string', '8.0'],
160+
['boolDefaultTrue', true, 'boolean', '8.0'],
161+
['boolDefaultFalse', false, 'boolean', '8.0'],
162+
['intDefault', 42, 'integer', '8.0'],
163+
['floatDefault', 3.14159, 'double', '8.0'],
164+
['arrayDefault', ['a' => 'b'], 'array', '8.0'],
165+
['iterableDefault', [0 => 1], 'array', '8.0'],
166+
['mixedDefault', 999, 'integer', '8.0'],
167167
];
168168

169169
echo PHP_EOL . 'Testing argument default values' . PHP_EOL;
@@ -194,7 +194,7 @@ public function setValue($value): void {
194194
['m', 'mixed', 1.23],
195195

196196
];
197-
if (PHP_VERSION_ID >= 70400) {
197+
if (PHP_VERSION_ID >= 80000) {
198198
echo PHP_EOL . 'Testing function typehints' . PHP_EOL;
199199
$reflection = new ReflectionFunction('integration_function_typehints');
200200
$params = $reflection->getParameters();

0 commit comments

Comments
 (0)