File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / reflection / tests / bug62384.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:00 2013 UTC (11 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #62384 (Attempting to invoke a Closure more than once causes segfaul)
--FILE--
<?php

$closure1   = function($val){ return $val; };
$closure2   = function($val){ return $val; };

$reflection_class   = new ReflectionClass($closure1);
$reflection_method  = $reflection_class->getMethod('__invoke');

$arguments1         = array('hello');
$arguments2         = array('world');

var_dump($reflection_method->invokeArgs($closure1, $arguments1));
var_dump($reflection_method->invokeArgs($closure2, $arguments2));

?>
--EXPECT--
string(5) "hello"
string(5) "world"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>