public static function fromNode(Node $node) {
if ($node instanceof Node\Name) {
+ if ($node->toLowerString() === 'static') {
+ // PHP internally considers "static" a builtin type.
+ return new SimpleType($node->toString(), true);
+ }
+
assert($node->isFullyQualified());
return new SimpleType($node->toString(), false);
}
return "IS_ITERABLE";
case "mixed":
return "IS_MIXED";
+ case "static":
+ return "IS_STATIC";
default:
throw new Exception("Not implemented: $this->name");
}
return "MAY_BE_CALLABLE";
case "mixed":
return "MAY_BE_ANY";
+ case "static":
+ return "MAY_BE_STATIC";
default:
throw new Exception("Not implemented: $this->name");
}
}
}
-static ZEND_METHOD(_ZendTestClass, __toString) /* {{{ */ {
+static ZEND_METHOD(_ZendTestClass, __toString) {
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_EMPTY_STRING();
}
-/* }}} */
/* Internal function returns bool, we return int. */
-static ZEND_METHOD(_ZendTestClass, is_object) /* {{{ */ {
+static ZEND_METHOD(_ZendTestClass, is_object) {
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG(42);
}
-/* }}} */
-static ZEND_METHOD(_ZendTestTrait, testMethod) /* {{{ */ {
+static ZEND_METHOD(_ZendTestClass, returnsStatic) {
+ ZEND_PARSE_PARAMETERS_NONE();
+ object_init_ex(return_value, zend_get_called_scope(execute_data));
+}
+
+static ZEND_METHOD(_ZendTestTrait, testMethod) {
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_TRUE;
}
-/* }}} */
PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("zend_test.observer.enabled", "0", PHP_INI_SYSTEM, OnUpdateBool, observer_enabled, zend_zend_test_globals, zend_test_globals)
/** @deprecated */
public function __toString(): string {}
+
+ public function returnsStatic(): static {}
}
trait _ZendTestTrait {
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1aa8e876ff9efb99c61603216eed267b0d225221 */
+ * Stub hash: 2d871bb7fda01594bb46f53bca64323424db4709 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_array_return, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestClass___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestClass_returnsStatic, 0, 0, IS_STATIC, 0)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class__ZendTestTrait_testMethod, 0, 0, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
static ZEND_FUNCTION(zend_iterable);
static ZEND_METHOD(_ZendTestClass, is_object);
static ZEND_METHOD(_ZendTestClass, __toString);
+static ZEND_METHOD(_ZendTestClass, returnsStatic);
static ZEND_METHOD(_ZendTestTrait, testMethod);
static const zend_function_entry class__ZendTestClass_methods[] = {
ZEND_ME(_ZendTestClass, is_object, arginfo_class__ZendTestClass_is_object, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
ZEND_ME(_ZendTestClass, __toString, arginfo_class__ZendTestClass___toString, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
+ ZEND_ME(_ZendTestClass, returnsStatic, arginfo_class__ZendTestClass_returnsStatic, ZEND_ACC_PUBLIC)
ZEND_FE_END
};