PHP doesn't work that way. In PHP all variables are local unless specifically defined as global. While a var keyword does exist in PHP it is optional and has no effect whatever on the scope of the variable. In fact PHP does have three other keywords that can be used when defining variables that do affect the scope of the variable and these are private, protected and public. Specifying var or not specifying any of these keywords is equivalent to specifying public.
Variables (properties) defined as public can be referenced from outside of the object that created them but only by making reference to the property within the object (eg. by using dot notation - object.property). Those defined as protected can be referenced from classes that inherit from the class containing them but cannot be accessed from anywhere else. Those defined as private are only accssible to objects where they belong to that class.
This article written by Stephen Chapman, Felgall Pty Ltd.