<?php class A { static function b() { echo "It works\n"; } } $theClass = "A"; $x = new $theClass; /* Are any of the following legal? Which? */ A::b(); $x->b(); $theClass::b(); ?>
November 15, 2005
Static Variable Variables
1 Comment »
RSS feed for comments on this post. TrackBack URL
Have you actually tried running this? All three work. =b
Comment by RW — February 19, 2014 @ 5:03 pm