xref: /PHP-7.2/ext/reflection/tests/bug62384.phpt (revision b8e946b0)
1--TEST--
2Bug #62384 (Attempting to invoke a Closure more than once causes segfaul)
3--FILE--
4<?php
5
6$closure1   = function($val){ return $val; };
7$closure2   = function($val){ return $val; };
8
9$reflection_class   = new ReflectionClass($closure1);
10$reflection_method  = $reflection_class->getMethod('__invoke');
11
12$arguments1         = array('hello');
13$arguments2         = array('world');
14
15var_dump($reflection_method->invokeArgs($closure1, $arguments1));
16var_dump($reflection_method->invokeArgs($closure2, $arguments2));
17
18?>
19--EXPECT--
20string(5) "hello"
21string(5) "world"
22