传统的重载: 方法名相同 形参不同;
<?php header("content-type:text/html;charset=uft-8"); class People { public function __construct(){ } public function getVal(val1){ } public function getVal(val1,val2){ } }
PHP 中的重载是伪重载,他的实现是在魔术方法中实现的:动态的实现
__call 魔术方法
传统的重载: 方法名相同 形参不同;
<?php header("content-type:text/html;charset=uft-8"); class People { public function __construct(){ } public function getVal(val1){ } public function getVal(val1,val2){ } }
PHP 中的重载是伪重载,他的实现是在魔术方法中实现的:动态的实现
__call 魔术方法