function convert($currencyType)
{
$that = $this;
return $result = function () use ($that)
{
if (!in_array($currencyType, $this->ratio))
return false;
return ($this->ratio[$currencyType] * $this->money); //a float number
};
}
$currency = new Currency();
echo $currency->convert('EURO');
What's wrong?
I'm getting the error message:
Catchable fatal error: Object of class Closure could not be converted to string