/ Published in: PHP
A class i started to implement, which ended up in a working concept
However I'm not sure if it's a legal way of programming since I unnessesery
changes the structure of php without some real value except nicer structure
For now it remain a concept
Usage:
concept::create()->create1();
concept::create()->create2();
concept::test()->test1();
concept::test()->test2();
However I'm not sure if it's a legal way of programming since I unnessesery
changes the structure of php without some real value except nicer structure
For now it remain a concept
Usage:
concept::create()->create1();
concept::create()->create2();
concept::test()->test1();
concept::test()->test2();
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* * A class i started to implement, which ended up in a working concept * However I'm not sure if it's a legal way of programming since I unnessesery * changes the structure of php without some real value except nicer structure * * For now it remain a concept * * Usage: * * concept::create()->create1(); * concept::create()->create2(); * concept::test()->test1(); * concept::test()->test2(); * */ class concept { 'create' => '__callStatic', 'create1' => 'create', 'create2' => 'create', 'test' => '__callStatic', 'test1' => 'test', 'test2' => 'test'); private $create = false; private function create1() { \pre::dump('create1'); } private function create2() { \pre::dump('create2'); } private function test1() { \pre::dump('test1'); } private function test2() { \pre::dump('test2'); } public static function __callStatic($name, $argument) { { $className = __class__; $new = new $className; $new->$name = true; return $new; } else { throw new \Exception('Static function in class <b>sql</b> does not exists; ' . $name); } } public function __call($name, $argument) { { } else { throw new \Exception('Function in class <b>sql</b> does not exists; ' . $name); } } }