Skip to content

Instantly share code, notes, and snippets.

@balibali
Created November 22, 2010 05:40
Show Gist options
  • Save balibali/709573 to your computer and use it in GitHub Desktop.
Save balibali/709573 to your computer and use it in GitHub Desktop.
<?php
class hoge
{
public static $fuga = 'tetete';
public function __construct() { self::$fuga = 'tatata'; }
public function hohoho() { return self::$fuga; }
public static function hehehe() { return self::$fuga; }
}
var_dump(hoge::$fuga); // string(6) "tetete"
var_dump(hoge::hehehe()); // string(6) "tetete"
$hoge = new hoge();
var_dump($hoge->hohoho()); // string(6) "tatata"
var_dump(hoge::hehehe()); // string(6) "tatata"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment