uopz_extend

Extend a class at runtime

Beschreibung

void uopz_extend ( string $class , string $parent )

Makes class extend parent

Parameter-Liste

class

The name of the class to extend

parent

The name of the class to inherit

Rückgabewerte

Beispiele

Beispiel #1 uopz_extend example

<?php
class {}
class 
{}

uopz_extend(A::class, B::class);

var_dump(class_parents(A::class));
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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