In PHP, the class is nested and inherited. in Class A, Class B is nested with Class B, and class B is inherited with class C. can it be implemented? ------ Solution -------------------- the class is definitely not nested. ------ solution -------------------- he said that nesting should be said to instantiate a class ........ _ ------ Solution ------------------ what does nesting mean? Nesting and inheritance of classes in instance PHP
A class B is nested in Class A, and class B is an inherited class C. can it be implemented?
------ Solution --------------------
Classes cannot be nested.
------ Solution --------------------
He said that nesting should mean instantiating a class ........ ===
------ Solution --------------------
What does nesting mean? Of course, it can be instantiated. it is not possible to define classes in a class.
------ Solution --------------------
No. why are you writing this?
Do you want to achieve this?
PHP code
Class C {public $ C = 'cname';} class B extends C {public $ B = 'bname';} class A {public $ B; function load () {$ this-> B = new B () ;}}$ A = new A (); $ A-> load (); echo $ A-> B-> C; echo $ A-> B;