Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<uopz_get_staticuopz_overload>
^Uopz FunctionsLast updated: Mon, 26 Oct 2026

uopz_implement

(PECL uopz 1, PECL uopz 2, PECL uopz 5, PECL uopz 6, PECL uopz 7 < 7.1.0)

uopz_implement — Implements an interface at runtime

Description

function uopz_implement(string $class, string $interface): bool

Makes class implement interface

Parameters

class

interface

Return Values

Returns true on success or false on failure.

Errors/Exceptions

As of PHP 7.4.0, uopz_implement() throws a RuntimeException, if OPcache is enabled, and the class entry of class is immutable.

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:

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

<uopz_get_staticuopz_overload>
^Uopz FunctionsLast updated: Mon, 26 Oct 2026