public static function convertVariableTo(\PHY\Variable\AVar $variable, $convertTo = 'Obj')
        {
            $method = 'to'.$convertTo;
            if (!is_callable([$variable, $method])) {
                throw new \PHY\Variable\Exception('Could not convert "'.$variable->getType().'" to "'.$convertTo.'"');
            }
            $value = $variable->{$method}();
            return static::create($convertTo, $value);
        }
public static function convertVariableTo(\PHY\Variable\AVar $variable, $convertTo = 'Obj')
        {
            $method = 'to'.$convertTo;
            if (!is_callable([$variable, $method])) {
                throw new \PHY\Variable\Exception('Could not convert "'.$variable->getType().'" to "'.$convertTo.'"');
            }
            $value = $variable->{$method}();
            return static::create($convertTo, $value);
        }
public static function convertVariableTo ( \ PHY \ Variable \ AVar $ variable , $ convertTo = 'Obj' ) { $ method = 'to' . $ convertTo ; if ( ! is_callable ( [ $ variable , $ method ] ) ) { throw new \ PHY \ Variable \ Exception ( 'Could not convert "' . $ variable -> getType ( ) . '" to "' . $ convertTo . '"' ) ; } $ value = $ variable -> { $ method } ( ) ; return static :: create ( $ convertTo , $ value ) ; }
Convert a variable to a different type.

@param \PHY\Variable\AVar $variable
@param string $convertTo
@return \PHY\Variable\AVar
Convert a variable to a different type .