1 | <?php |
||
10 | class SerializableFunc{ |
||
11 | /** |
||
12 | * 方法,绑定参数 |
||
13 | * 如 |
||
14 | * func,arg1,arg2 |
||
15 | * array('a','method1'), arg1,arg2 |
||
16 | */ |
||
17 | public function __construct(callable $func){ |
||
22 | |||
23 | /** |
||
24 | * |
||
25 | * 调用时,将bind参数加在方法的最前面 |
||
26 | * @return mixed |
||
27 | */ |
||
28 | public function __invoke(){ |
||
40 | /** |
||
41 | * 串行调用 |
||
42 | * @var callable[] |
||
43 | */ |
||
44 | public $next=array(); |
||
45 | private $bind; |
||
46 | private $func; |
||
47 | } |
||
48 | |||
49 | ?> |
||
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.