2016-02-26 8:07 GMT+05:00 Aziz Saleh <azizsaleh@xxxxxxxxx>: > Sorry, I didn't notice you were printing original array and not found. I > would advise you remove all pass by reference logic, it would yield the > same results. This is different because I expected that when i change $found variable which referenced to ['aaa', 'bbb', 'ccc'] leaf after first call, i change leaf ['aaa', 'bbb', 'ccc'] in tree. If I remove reference logic code will be change only $found variable. -- Best Regards, Mike Gavrilov.