Inheritance/Single: Difference between revisions

Content deleted Content added
Complete D entry
→‎{{header|Perl 6}}: update to modern meaning of .^parents
Line 876:
=={{header|Perl 6}}==
 
{{works with|Rakudo Star|20102012.0706}}
<lang perl6>class Animal {}
class Dog is Animal {}
Line 885:
say ~Collie.^parents; # undefined type object
say ~Collie.new.^parents; # instantiated object</lang>
{{out}}
<pre>Dog() Animal() Any() Mu()
Dog() Animal() Any() Mu()<br/pre>
 
The <tt>.^parents</tt> notation indicates a method call to the object's metaobject rather than to the object itself.
Output:
 
Dog() Animal() Any() Mu()<br>
Dog() Animal() Any() Mu()
 
=={{header|PHP}}==