Answer the question
In order to leave comments, you need to log in
How to get "into the depths" of an object?
Hi, next question.
There is an object A
There is B that inherits A
, A has a $var variable
and has an add() method
(which, logically, B also has)
When adding() is called, the B object must be written to the very end of the chain in the $var variable I
explain on my fingers:
call add ()
Press again
I beg you:
1. do not throw slippers, but I'm a noob
2. Do not spoil the answer. but push towards a solution. I've tried different iteration methods. I can climb into the depths, but I don’t know how to “climb out”
or something else
Thank you! А([var]=>)
A([var]=>B([var]=>))
A([var]=>B([var]=>B([var]=>)))
Answer the question
In order to leave comments, you need to log in
Well, $var is an array, so work with it like an array. All elements match the order in which add is called.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question