i am wondering is it possible to restrict php variable to accept only certain type of variable it is defined to accept.
e-g if we see in C#
public in
You have to made it by your own hands, example :
function setInt(&$var, $value) { if(!is_integer($value) { throw new Exception("Integer wanted " . gettype($value) . " received"); } $var = $value; }