Skip to content

Instantly share code, notes, and snippets.

@jmarrama
Created April 16, 2014 23:36
Show Gist options
  • Select an option

  • Save jmarrama/10942474 to your computer and use it in GitHub Desktop.

Select an option

Save jmarrama/10942474 to your computer and use it in GitHub Desktop.
<?php
class A {
use B;
}
class C extends A {}
trait B {
}
$c = new C();
$a = new A();
var_dump($c instanceof A);
var_dump($a instanceof B);
var_dump($c instanceof B);
// outputs:
//bool(true)
//bool(false)
//bool(false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment