Advertisement
Guest User

Untitled

a guest
Mar 7th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. PHP_FUNCTION(wat){
  2. zend_class_entry *destination_class = NULL;
  3. zend_class_entry *extensions_trait = NULL;
  4. if(
  5. zend_parse_parameters(
  6. ZEND_NUM_ARGS() TSRMLS_CC,
  7. "CC",
  8. &destination_class,
  9. &extensions_trait
  10. ) == FAILURE
  11. ){
  12. RETURN_STRING("LOL");
  13. }
  14. zend_do_implement_trait(destination_class, extensions_trait);
  15. RETURN_STRING("YAY");
  16. }
  17.  
  18.  
  19.  
  20.  
  21.  
  22. trait Foo{
  23. function qux(){ return "ITSALIIIVE"; }
  24. }
  25. class Bar{}
  26. var_dump(\wat(Bar::CLASS, Foo::CLASS));
  27. $x = new Bar();
  28. var_dump($x->qux());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement