示例#1
0
文件: phpcall.php 项目: rzhw/Fructose
function __marshal2fruc($phpval)
{
    if (is_bool($phpval)) {
        return F_TrueClass::__from_bool($phpval);
    }
    if (is_numeric($phpval) && !is_string($phpval)) {
        return F_Number::__from_number($phpval);
    }
    if (is_string($phpval)) {
        return F_String::__from_string($phpval);
    }
    if (is_object($phpval)) {
        return F_PHPObject::__from_object($phpval);
    }
    if (is_array($phpval)) {
        // determine if assoc or numeric
        $isAssoc = FALSE;
        foreach (array_keys($phpval) as $k) {
            if (!is_numeric($k)) {
                $isAssoc = TRUE;
                break;
            }
        }
        if (!$isAssoc) {
            return F_Array::__from_array(array_map('__marshal2fruc', $phpval));
        }
        foreach ($phpval as $k => $v) {
            $newarr[] = __marshal2fruc($k);
            $newarr[] = __marshal2fruc($v);
        }
        return F_Hash::__from_flatpairs($newarr);
    }
    return new F_NilClass();
}
示例#2
0
 public function F_to_n($block)
 {
     return F_Number::__from_number($this->__STRING);
 }
示例#3
0
文件: pdo.php 项目: rzhw/frucnatra
 public function F_size($block)
 {
     return F_Number::__from_number($this->__STMT->rowCount());
 }