Skip to content

Commit c8b9636

Browse files
committed
fix 8.0-8.2
1 parent 1f06ebe commit c8b9636

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

phper-sys/php_wrapper.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,11 @@ phper_zend_begin_arg_with_return_obj_info_ex(bool return_reference,
521521
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(infos, return_reference, required_num_args, class_name, allow_null)
522522
ZEND_END_ARG_INFO()
523523
zend_internal_arg_info info = infos[0];
524-
info.type.ptr = zstr;
524+
#if PHP_VERSION_ID >= 80300
525+
info.type.ptr = zstr;
526+
#else
527+
info.type.ptr = ZSTR_VAL(zstr);
528+
#endif
525529
info.type.type_mask = _ZEND_TYPE_NAME_BIT | (allow_null ? MAY_BE_NULL : 0);
526530
return info;
527531
#else
@@ -575,7 +579,11 @@ zend_internal_arg_info phper_zend_arg_obj_info(bool pass_by_ref,
575579
};
576580
zend_internal_arg_info info = infos[0];
577581
info.name = name;
578-
info.type.ptr = zstr;
582+
#if PHP_VERSION_ID >= 80300
583+
info.type.ptr = zstr;
584+
#else
585+
info.type.ptr = ZSTR_VAL(zstr);
586+
#endif
579587
info.type.type_mask = _ZEND_TYPE_NAME_BIT | (allow_null ? MAY_BE_NULL : 0);
580588
return info;
581589
#elif PHP_VERSION_ID >= 70200

tests/integration/tests/php/typehints.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function setValue($value): void {
203203
echo(sprintf("argument %d..", $i));
204204
assert_eq($input[0], $params[$i]->getName(), sprintf('argument %d has correct name', $i));
205205
assert_eq($input[1], $params[$i]->getType()->getName(), sprintf('argument %d has correct type', $i));
206-
if ($input[2]) {
206+
if (array_key_exists(2, $input)) {
207207
assert_eq($input[2], $params[$i]->getDefaultValue(), sprintf('argument %d has correct default value', $i));
208208
}
209209
echo "PASS" . PHP_EOL;

0 commit comments

Comments
 (0)