1--TEST--
2Calling a builtin function with 'static' return type from internal code
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7
8enum IntIntStaticInt : int {
9	case Life = 42;
10}
11
12enum IntIntStaticString : string {
13	case ThanksFor = "all the fish";
14}
15
16var_dump(zend_call_method(IntIntStaticInt::class, "from", 42));
17var_dump(zend_call_method(IntIntStaticInt::class, "tryFrom", 42));
18var_dump(zend_call_method(IntIntStaticString::class, "from", "all the fish"));
19var_dump(zend_call_method(IntIntStaticString::class, "tryFrom", "all the fish"));
20
21class StillReturnsStatic extends _ZendTestClass {}
22
23var_dump(get_class(zend_call_method(_ZendTestClass::class, "returnsStatic")));
24var_dump(get_class(zend_call_method(StillReturnsStatic::class, "returnsStatic")));
25
26--EXPECT--
27enum(IntIntStaticInt::Life)
28enum(IntIntStaticInt::Life)
29enum(IntIntStaticString::ThanksFor)
30enum(IntIntStaticString::ThanksFor)
31string(14) "_ZendTestClass"
32string(18) "StillReturnsStatic"
33