xref: /PHP-5.5/ext/reflection/tests/bug64007.phpt (revision e6bde1f8)
1--TEST--
2Bug #64007 (There is an ability to create instance of Generator by hand)
3--FILE--
4<?php
5$reflection = new ReflectionClass('Generator');
6try {
7    $generator = $reflection->newInstanceWithoutConstructor();
8    var_dump($generator);
9} catch (Exception $e) {
10    var_dump($e->getMessage());
11}
12
13$generator  = $reflection->newInstance();
14var_dump($generator);
15?>
16--EXPECTF--
17string(97) "Class Generator is an internal class that cannot be instantiated without invoking its constructor"
18
19Catchable fatal error: The "Generator" class is reserved for internal use and cannot be manually instantiated in %sbug64007.php on line %d
20