Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP_FUNCTION(wat){
- zend_class_entry *destination_class = NULL;
- zend_class_entry *extensions_trait = NULL;
- if(
- zend_parse_parameters(
- ZEND_NUM_ARGS() TSRMLS_CC,
- "CC",
- &destination_class,
- &extensions_trait
- ) == FAILURE
- ){
- RETURN_STRING("LOL");
- }
- zend_do_implement_trait(destination_class, extensions_trait);
- RETURN_STRING("YAY");
- }
- trait Foo{
- function qux(){ return "ITSALIIIVE"; }
- }
- class Bar{}
- var_dump(\wat(Bar::CLASS, Foo::CLASS));
- $x = new Bar();
- var_dump($x->qux());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement