3.2.2 - 普通 - 已关闭
问题1: Functions.php 函数: parse_name 我在阿里云服务器里执行时会报错如下:Parse error: syntax error, unexpected T_FUNCTION in /alidata/www/dreamfans/gosung/Library/Function.php on line 1415
问题2: Model.class.php 中 parseSql函数的倒数第4行也有这问题
问题3: Model.class.php 中 table()函数的倒数第5行也有这问题
问题4: Model.class.php 中 using()函数 有一处此问题
问题5: Model.class.php 中 join()函数 有两处此问题
问题6: Model.class.php 中union()函数也有一处此问题
是这函数里边代码兼容性不好???
注:我阿里云服务器是linux环境: PHP 5.2.17p1
/**
* 字符串命名风格转换
* type 0 将Java风格转换为C的风格 1 将C风格转换为Java的风格
* @param string $name 字符串
* @param integer $type 转换类型
* @return string
*/
function parse_name($name, $type=0) {
if ($type) {
return ucfirst(preg_replace_callback('/_([a-zA-Z])/', function($match){return strtoupper($match[1]);}, $name));
} else {
return strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $name), "_"));
}
} 