> On Jan 9, 2020, at 3:29 PM, Ralph Schindler <ra...@ralphschindler.com> 
> wrote:How would you get the right semantics out of $object::interface, or 
> $object::trait, and/or do you have an example of what you're expecting?

Sorry, I was only thinking about using it on Interface and Trait names, not on 
objects.

I have a lot of code that looks like this:

use Interfaces;
if ( ! implements_interface( $object, Interfaces\MyInterface::class, 
$trigger_error = true )) {
   return; 
}

And it feels wrong. I would love to be able to use ::interface, i.e.:

use Interfaces;
if ( implements_interface( $object, Interfaces\MyInterface::interface, 
$trigger_error = true )) {
   return; 
}

-Mike

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to