2013-01-19 09:01:57 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #64007 (There is an ability to create instance of Generator by hand)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$reflection = new ReflectionClass('Generator');
|
2013-01-22 08:58:40 +00:00
|
|
|
try {
|
|
|
|
$generator = $reflection->newInstanceWithoutConstructor();
|
|
|
|
var_dump($generator);
|
|
|
|
} catch (Exception $e) {
|
|
|
|
var_dump($e->getMessage());
|
|
|
|
}
|
|
|
|
|
2013-01-19 09:01:57 +00:00
|
|
|
$generator = $reflection->newInstance();
|
|
|
|
var_dump($generator);
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2014-07-30 08:08:26 +00:00
|
|
|
string(%d) "Class Generator is an internal class marked as final that cannot be instantiated without invoking its constructor"
|
2013-01-22 08:58:40 +00:00
|
|
|
|
2015-05-17 22:31:43 +00:00
|
|
|
Fatal error: Uncaught Error: The "Generator" class is reserved for internal use and cannot be manually instantiated in %sbug64007.php:%d
|
2015-05-15 19:04:07 +00:00
|
|
|
Stack trace:
|
|
|
|
#0 %s(%d): ReflectionClass->newInstance()
|
|
|
|
#1 {main}
|
|
|
|
thrown in %sbug64007.php on line %d
|