To better understand what is happening here, let us break it down a bit. $this->privateProp points to the outerClass property privateProp and is passed as an argument to the NANC. The NANC's constructor is assigning the value of the argument to its own property newProp.
from My Pocket http://www.phpclasses.org/blog/post/325-PHP-7-Nested-Anonymous-Classes-Tutorial.html
No comments:
Post a Comment