Hi Derick
which syntax is clear ?
current syntax ?
//---------------------------------------------------
class testClass {
function __set($name,&$value)
{
switch ($name)
{
case 'propertyOne':
{
//do something
$value='anything';
return true;
break;
}
case 'propertyTwo':
{
//do something
break;
}
}
}
}
or c# like syntax ?
//---------------------------------------------------------------
class testClass {
var $propertyOne
{
get
{
//do something
return $value;
}
set
{
//do something
$propertyOne=$value;
}
}
}
It was just a suggestion to better (clear and bugfree) coding .
Masoud
"Derick Rethans" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> On Sun, 20 Jul 2003, Masoud wrote:
>
> > I knew __get and __set available, but i want to told C# like syntax is a
> > nice and clear syntax if available in php5 ,
> > so we dont need to check property name and then set value .
>
> You can use C# for that ;) No really, I think the PHP 5 syntax is okay
> here, PHP is just not C#.
>
> regards,
> Derick
>
> --
> "Interpreting what the GPL actually means is a job best left to those
> that read the future by examining animal entrails."
> -------------------------------------------------------------------------
> Derick Rethans http://derickrethans.nl/
> International PHP Magazine http://php-mag.net/
> -------------------------------------------------------------------------
>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php