1. Soru:
PHP var:
$b = new SomeClass();
$a = "foo";
$b->$a("something"); // This is the same as $b->foo("something");
Bu C # nasıl yapabilirim?
2. Soru:
PHP Ben benzer bir sınıf, her yöntemi ile yineleme yapabilirsiniz:
$a = new SomeClass(); // Which implements methodA, methodB;
foreach($method in get_class_methods(SomeClass()))
{
$method("do stuff with each method");
}
C # bunu nasıl?
3. Soru
Sınıf gibi sanki bir yöntem çalıştırabilirsiniz hala yok bir varsayılan olarak yürütür bir yöntem uygulamak değilse PHP __call() sihirli bir yöntemi vardır
class NewClass()
{
// constructor
__call(class name, array of parameters)
{
}
}
yani bunu yaparsanız
$a = new NewClass();
$a->thisDoesntExistButWorks("123","abc");
// The method gets "magically created" such as
thisDoesntExistButWorks(array with 123 and abc)....