mirror of
https://github.com/php/php-src.git
synced 2024-10-20 16:02:44 +00:00
27 lines
376 B
Plaintext
27 lines
376 B
Plaintext
|
--TEST--
|
||
|
ZE2 type hinting
|
||
|
--SKIPIF--
|
||
|
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class Foo {
|
||
|
}
|
||
|
|
||
|
class Bar {
|
||
|
}
|
||
|
|
||
|
function type_hint_foo(Foo $a) {
|
||
|
}
|
||
|
|
||
|
$foo = new Foo;
|
||
|
$bar = new Bar;
|
||
|
|
||
|
type_hint_foo($foo);
|
||
|
type_hint_foo($bar);
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
|
||
|
Fatal error: Argument 1 must be an instance of foo in %s on line %d
|