Should I use C#-like property handling in PHP?

HappyWatchers

New Member
Hey SO community,I saw here: http://www.mustap.com/phpzone_post_203_setter-and-getter an argument for using a type of property handling common to C#, that is:If in C#, you can define a class like this:\[code\]public class Person { private string _name; public string Name { get{ return _name; } set{ _name = value; } }}\[/code\]then why is it wise or not to define a similar property in php like this:\[code\]public class Person{ private var $name; public function Name() { if(func_num_args() == 0) { return $this->name; } else {$this->name = func_get_arg(0); } }}\[/code\]
 
Back
Top