update page now

Voting

: min(zero, nine)?
(Example: nine)

The Note You're Voting On

rawsrc
7 years ago
About the (Safak Ozpinar / safakozpinar at gmail)'s great note, you can still have the same behavior than inheritance using trait with this approach : 
<?php

trait TestTrait {
    public static $_bar;
}

class FooBar {
    use TestTrait;
}

class Foo1 extends FooBar {

}
class Foo2 extends FooBar {

}
Foo1::$_bar = 'Hello';
Foo2::$_bar = 'World';
echo Foo1::$_bar . ' ' . Foo2::$_bar; // Prints: World World

<< Back to user notes page

To Top