概念:php多维方法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了概念:php多维方法相关的知识,希望对你有一定的参考价值。
A class i started to implement, which ended up in a working conceptHowever 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();
/* * 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); } } }
以上是关于概念:php多维方法的主要内容,如果未能解决你的问题,请参考以下文章