In C #, you can have nested classes that are useful if you have classes that don't matter outside the scope of one particular class, for example. in the factory template:
public abstract class BankAccount { private BankAccount() {} private sealed class SavingsAccount : BankAccount { ... } private sealed class CheckingAccount : BankAccount { ... } public BankAccount MakeSavingAccount() { ... } public BankAccount MakeCheckingAccount() { ... } }
Is this possible in PHP?
I read that it was planned for PHP 5, then canceled, then planned again, but cannot find the final information.
Does anyone know how to create nested classes (classes within another class) like in the above C # example using PHP 5.3?
source share