rfc:namespace-visibility

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:namespace-visibility [2018/07/18 21:37] mdwheelerfc:namespace-visibility [2018/07/18 21:38] mdwheele
Line 153: Line 153:
 </code> </code>
  
-Because ''\Example\Nested'' shares a parent-namespace with ''\Example\ProtectedClass'', it can instantiate the class through its ''protected'' namespace visibility. Instantiation of classes within functions and closures behaves no different than if executed at the root of the namespace. All that matters is the namespace that the code is executing *from* compared to the *target class* namespace and modifier.+Because ''\Example\Nested'' shares a parent-namespace with ''\Example\ProtectedClass'', it can instantiate the class through its ''protected'' namespace visibility. Instantiation of classes within functions and closures behaves no different than if executed at the root of the namespace. All that matters is the namespace that the code is executing **from** compared to the **target class** namespace and modifier.
  
 <code php> <code php>
rfc/namespace-visibility.txt · Last modified: 2018/07/18 21:42 by mdwheele