Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

define constructor in trait php

class MyHelloWorld extends Base {

    use SayWorld {
        SayWorld::__construct as private __swConstruct;
    }

    public function __construct($a, $b, $c = 0)
    {
        $this->__swConstruct($a, $b, $c);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #define #constructor #trait #php
ADD COMMENT
Topic
Name
8+3 =