xref: /PHP-8.1/Zend/tests/enum/__invoke.phpt (revision 269c8dac)
1--TEST--
2Enum __invoke
3--FILE--
4<?php
5
6enum Foo {
7    case Bar;
8
9    public function __invoke(...$args)
10    {
11        return $args;
12    }
13}
14
15var_dump((Foo::Bar)('baz', 'qux'));
16
17?>
18--EXPECT--
19array(2) {
20  [0]=>
21  string(3) "baz"
22  [1]=>
23  string(3) "qux"
24}
25