diff --git a/Zend/tests/closures/closure_instantiate.phpt b/Zend/tests/closures/closure_instantiate.phpt new file mode 100644 index 00000000000..fa936a219b8 --- /dev/null +++ b/Zend/tests/closures/closure_instantiate.phpt @@ -0,0 +1,21 @@ +--TEST-- +Closures cannot be instantiated directly +--CREDITS-- +Mark Baker mark@lange.demon.co.uk at the PHPNW2017 Conference for PHP Testfest 2017 +--FILE-- +getMessage(); +} catch (Throwable $e) { + // This is the mesage that we should see for a caught error + echo 'ERROR: ', $e->getMessage(); +} + +?> +--EXPECT-- +ERROR: Instantiation of 'Closure' is not allowed