note 93534 deleted from language.oop5.typehinting by cmb
| From: | cmb@php.net | Date: | Sat, 10 Dec 2016 11:41:58 +0000 |
| Subject: | note 93534 deleted from language.oop5.typehinting by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208436@lists.php.net to get a copy of this message | ||
Note Submitter: reinier dot kip at gmail dot com
----
Please note that when using the type hinting class together with namespaces, you're asking for
trouble:
<?php
namespace a {
interface A {
public function execute(string $sth);
}
}
namespace a\b {
class B implements a\A {
public function execute(string $sth){} // Wrong
public function execute(a\string $sth){} // Correct
}
} // Causes a fatal error on this line. 'string' is considered an object from the
namespace 'a'
?>