Skip to content

Instantly share code, notes, and snippets.

@dseguy
Last active October 1, 2016 14:27
Show Gist options
  • Save dseguy/da0326a7418a50738e29be05a3c7eaaf to your computer and use it in GitHub Desktop.
Save dseguy/da0326a7418a50738e29be05a3c7eaaf to your computer and use it in GitHub Desktop.
<?php
trait t {
public static $c = 1;
static function foo() {
echo ++t::$c;
// This leaves the property in the local structure
//echo ++self::$c;
}
}
class x { use t; }
class y { use t; }
echo x::foo();
echo t::foo();
echo y::foo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment