Skip to content

Commit

Permalink
Review round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Jul 20, 2020
1 parent dc8e8ff commit 9ae0493
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
24 changes: 12 additions & 12 deletions Zend/tests/002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,26 @@ try {
echo "Done\n";
?>
--EXPECTF--
func_get_arg(): Argument #1 ($argument_number) must be greater than or equal to 0
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($argument_number) must be greater than or equal to 0
func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
int(10)
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
int(1)
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
Exception: Too few arguments to function test2(), 0 passed in %s002.php on line %d and exactly 1 expected
int(1)
int(2)
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($argument_number) must be greater than or equal to 0
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected
int(1)
int(2)
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
int(1)
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
func_get_arg() cannot be called from the global scope
Done
2 changes: 1 addition & 1 deletion Zend/tests/020.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ try {
?>
--EXPECT--
func_get_arg() cannot be called from the global scope
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
3 changes: 1 addition & 2 deletions Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,7 @@ ZEND_FUNCTION(define)
}

if (non_cs) {
zend_error(E_WARNING, "define(): Declaration of case-insensitive constants is no longer supported");
RETURN_FALSE;
zend_error(E_WARNING, "define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported");
}

ZVAL_UNDEF(&val_free);
Expand Down
14 changes: 8 additions & 6 deletions Zend/zend_builtin_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function zend_version(): string {}

function func_num_args(): int {}

function func_get_arg(int $argument_number): mixed {}
function func_get_arg(int $position): mixed {}

function func_get_args(): array {}

Expand All @@ -22,7 +22,7 @@ function strncasecmp(string $string1, string $string2, int $length): int {}

function error_reporting(?int $error_level = null): int {}

/** @param bool|int|float|string|array|resource|null $value */
/** @param mixed $value */
function define(string $constant_name, $value, $case_insensitive = false): bool {}

function defined(string $constant_name): bool {}
Expand All @@ -33,9 +33,11 @@ function get_called_class(): string {}

function get_parent_class(string|object $object = UNKNOWN): string|false {}

function is_subclass_of($object, string $class_name, bool $allow_string = true): bool {}
/** @param object|string $object */
function is_subclass_of(mixed $object, string $class_name, bool $allow_string = true): bool {}

function is_a($object, string $class_name, bool $allow_string = false): bool {}
/** @param object|string $object */
function is_a(mixed $object, string $class_name, bool $allow_string = false): bool {}

function get_class_vars(string $class_name): array|false {}

Expand All @@ -47,10 +49,10 @@ function get_mangled_object_vars(object $object): array {}
function get_class_methods($class): array {}

/** @param object|string $object_or_class */
function method_exists($object_or_class, string $method): bool {}
function method_exists(mixed $object_or_class, string $method): bool {}

/** @param object|string $object_or_class */
function property_exists($object_or_class, string $property_name): bool {}
function property_exists(mixed $object_or_class, string $property): bool {}

function class_exists(string $class_name, bool $autoload = true): bool {}

Expand Down
10 changes: 5 additions & 5 deletions Zend/zend_builtin_functions_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 13ccb76ae84972dc12a26555e9d8652e58150378 */
* Stub hash: b54cd767a1c2fd07865460fc9df8368ee988c823 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand All @@ -8,7 +8,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_func_num_args, 0, 0, IS_LONG, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_func_get_arg, 0, 1, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, argument_number, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_func_get_args, 0, 0, IS_ARRAY, 0)
Expand Down Expand Up @@ -58,13 +58,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_get_parent_class, 0, 0, MAY_BE_S
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_subclass_of, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, object)
ZEND_ARG_TYPE_INFO(0, object, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, allow_string, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is_a, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, object)
ZEND_ARG_TYPE_INFO(0, object, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, allow_string, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
Expand All @@ -90,7 +90,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_property_exists, 0, 2, _IS_BOOL, 0)
ZEND_ARG_INFO(0, object_or_class)
ZEND_ARG_TYPE_INFO(0, property_name, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_exists, 0, 1, _IS_BOOL, 0)
Expand Down
3 changes: 1 addition & 2 deletions ext/com_dotnet/com_com.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,7 @@ PHP_FUNCTION(com_load_typelib)
}

if (!cs) {
php_error_docref(NULL, E_WARNING, "Declaration of case-insensitive constants is no longer supported");
RETURN_FALSE;
php_error_docref(NULL, E_WARNING, "com_load_typelib(): Argument #2 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported");
}

RETVAL_FALSE;
Expand Down
2 changes: 1 addition & 1 deletion tests/lang/func_get_arg.004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ foo(2, 3);

?>
--EXPECT--
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
4 changes: 2 additions & 2 deletions tests/lang/func_get_arg_variation.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ foo(2);

?>
--EXPECT--
func_get_arg(): Argument #1 ($argument_number) must be greater than or equal to 0
func_get_arg(): Argument #1 ($argument_number) must be less than the number of the arguments passed to the currently executed function
func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function

0 comments on commit 9ae0493

Please sign in to comment.