fonksiyonlar global düzeyde tanımlanır; bu nedenle, size sınıfının bir yöntemi onları kullanmak için bir şey yapmanız gerekmez.
Daha fazla bilgi almak için, function page in the manual görürsünüz, (alıntı) hangi devletler:
All functions and classes in PHP have
the global scope - they can be called
outside a function even if they were
defined inside and vice versa.
For your $foo
variable, on the other hand, you have to use the global
keyword inside each method/function in which you want to access it.
Daha fazla bilgi almak için, size ilginç bilgiler getirmelidir ki, Variable scope ile ilgili sayfayı okumak için çekinmeyin ;-)
Edit after the comment :
Each method/function regardless of it
being defined within a class or not?
Bir "yöntem" denir: bir "fonksiyonu" bir sınıf içinde tanımlanmış ise, o hala function
kullanılırsa olsa bile, artık bir "fonksiyonu" denir değil
Yöntem statik olarak kullanılabilir:
MyClass::myMethod();
Veya Dinamik:
$obj = new MyClass();
$obj->myMethod();
Onlar static ya da değil olarak tanımlanan edilip bağlı.
As a sidenote : if you are new to OOP in PHP, you should definitly invest some time to read the Classes and Objects (PHP 5) section of the manual : it will explain much.