Query: uopz_compose
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
UOPZ_COMPOSE(3) 1 UOPZ_COMPOSE(3) uopz_compose - Compose a classSYNOPSISvoid uopz_compose (string $name, array $classes, [array $methods], [array $properties], [int $flags])DESCRIPTIONCreates a new class of the given name that implements, extends, or uses all of the provided classesPARAMETERSo $name - A legal class name o $classes - An array of class, interface and trait names o $methods - An associative array of methods, values are either closures or [modifiers => closure] o $properties - An associative array of properties, keys are names, values are modifiers o $flags - Entry type, by default ZEND_ACC_CLASSRETURN VALUESEXAMPLESExample #1 uopz_compose(3) example <?php class myClass {} trait myTrait {} interface myInterface {} uopz_compose( Composed::class, [ myClass::class, myTrait::class, myInterface::class ], [ "__construct" => function() { /* ... */ } ]); var_dump( class_uses(Composed::class), class_parents(Composed::class), class_implements(Composed::class)); ?> The above example will output something similar to: array(1) { ["myTrait"]=> string(7) "myTrait" } array(1) { ["myClass"]=> string(7) "myClass" } array(1) { ["myInterface"]=> string(11) "myInterface" } PHP Documentation Group UOPZ_COMPOSE(3)
Related Man Pages |
---|
property_exists(3) - php |
aggregate_info(3) - php |
yaf_bootstrap_abstract(3) - php |
cubrid_fetch_object(3) - php |
class::trait::reflection(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
delete in c++ |
How to return void function pointer |
Problem with lookup values on AWK associative array |
PHP populate variable with function |
Loading associative array from exported function |