mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Fix class type hints example.
This commit is contained in:
parent
3cfc8a1ecc
commit
55826fbeb5
@ -191,15 +191,15 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
This means that
|
||||
|
||||
function foo(Class $object) {
|
||||
function foo(ClassName $object) {
|
||||
// ...
|
||||
}
|
||||
|
||||
is equivalent to
|
||||
|
||||
function foo(Class $object) {
|
||||
if (!($object instanceof Class)) {
|
||||
die('Argument 1 must be an instance of Class');
|
||||
function foo($object) {
|
||||
if (!($object instanceof ClassName)) {
|
||||
die('Argument 1 must be an instance of ClassName');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user