diff --git a/tests/bugs/gh167.phpt b/tests/bugs/gh167.phpt new file mode 100644 index 0000000..97aa302 --- /dev/null +++ b/tests/bugs/gh167.phpt @@ -0,0 +1,17 @@ +--TEST-- +uopz_set_return() overload confusion +--EXTENSIONS-- +uopz +--INI-- +uopz.disable=0 +--FILE-- + +--EXPECT-- +int(4711) diff --git a/uopz.c b/uopz.c index 9c05307..936f759 100644 --- a/uopz.c +++ b/uopz.c @@ -197,6 +197,7 @@ static PHP_FUNCTION(uopz_set_return) uopz_disabled_guard(); if (uopz_parse_parameters("CSz|b", &clazz, &function, &variable, &execute) != SUCCESS && + !((clazz = NULL)) && uopz_parse_parameters("Sz|b", &function, &variable, &execute) != SUCCESS) { uopz_refuse_parameters( "unexpected parameter combination, expected (class, function, variable [, execute]) or (function, variable [, execute])");