Skip to content

Instantly share code, notes, and snippets.

@elgamine-dev
Created July 24, 2017 14:17
Show Gist options
  • Save elgamine-dev/b08922414e653e2148aedc4697494dfc to your computer and use it in GitHub Desktop.
Save elgamine-dev/b08922414e653e2148aedc4697494dfc to your computer and use it in GitHub Desktop.
POO
<?php
class Test {
private $name = 'plop';
private $title = "eee";
public function __construct() {
$this->date = date('c');
echo $this->name;
}
public function __destruct() {
}
public function main() {
}
}
class Fork extends Test {
private static $foo = 'bar';
public function main(){
parent::main();
echo $this->name;
}
public static function stuff($a, $b) {
return self::$foo;
}
}
echo PHP_EOL;
echo Fork::stuff(1,2);
echo PHP_EOL;
echo PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment