Örneğin ben bunu sınıflar ve yöntemler bir dizi var diyelim:
$obj->method1()->method2();
Onun son bilmek onun ilk yöntem denir ya Method2 için varlık kendi içinde birlikte bilmek Method1 () için yine de var mı?
Some more details
I just want to be able to build a set of these calls so that it either returns an instance of itself if the call to the method isnt at the end of the chain or return something different if its at the end.
Örneğin
$obj->method1()->method2(); #Here method 2 will return lets say a string.
$obj->method1()->method2()->method3(); #Since method2 isnt at the end of the chain, it should return an instance of itself (or another object) here so that the chain could continue.
EDIT: anyone whoz trying to do this - it is a bad design pattern.
Bu yinelenen olarak görünüyor. Daha cevaplar için this question bakın.