php-src/tests/classes/interfaces_003.phpt
Nikita Popov 440481fb3e Display TypeExceptions like normal exceptions
We currently don't show the argument at which the error actually
occured in the trace - should probably either add it or don't
display args on incomplete frames altogether, otherwise this'll
probably be confusing.
2015-05-17 19:54:12 +02:00

31 lines
559 B
PHP

--TEST--
ZE2 interface and __construct
--FILE--
<?php
class MyObject {}
interface MyInterface
{
public function __construct(MyObject $o);
}
class MyTestClass implements MyInterface
{
public function __construct(MyObject $o)
{
}
}
$obj = new MyTestClass;
?>
===DONE===
--EXPECTF--
Fatal error: Uncaught TypeException: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php:%d
Stack trace:
#0 %s(%d): MyTestClass->__construct()
#1 {main}
thrown in %sinterfaces_003.php on line %d