GoLang uopz_implement

request it (336)
GoLang replacement for PHP's uopz_implement [edit | history]



Do you know a GoLang replacement for PHP's uopz_implement? Write it!

PHP uopz_implement

PHP original manual for uopz_implement [ show | php.net ]

uopz_implement

(PECL uopz 1, PECL uopz 2, PECL uopz 5)

uopz_implementImplements an interface at runtime

Description

bool uopz_implement ( string $class , string $interface )

Makes class implement interface

Parameters

class

interface

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 uopz_implement() example

<?php
interface myInterface {}

class 
myClass {}

uopz_implement(myClass::class, myInterface::class);

var_dump(class_implements(myClass::class));
?>

The above example will output something similar to:

array(1) {
  ["myInterface"]=>
  string(11) "myInterface"
}