1 2 3 4 | class Dictionary { public static $iodir="."; // ... } |
1 2 | print Dictionary:iodir . "\n"; Dictionary:iodir = "/tmp"; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | class Dictionary { private static $iodir="."; // ... public static function setSaveDirectory( $dir ) { if ( ! is_dir( $dir ) || ! is_writable( $dir ) ) { return false; } self:iodir = $dir; } public static function getSaveDirectory( ) { return self:iodir; } // ... } |
1 2 | Dictionary::setSaveDirectory("/tmp"); print Dictionary::getSaveDirectory(); |
1 2 3 4 5 | class Dictionary { const MAXLENGTH = 250; // ... } print Dictionary::MAXLENGTH; |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |