<? PHP /* Product */ Class Product { Public Static $ Count = 0 ; Public $ Name ='' ; Public Function Show (){ Print ('<P> show method </P>' );} Public Static Function Display (){ Print ('<P> display static method </>' );}} $ Class = New Reflectionclass ('product' ); Print "<PRE>" ; Reflection : Export ($ Class ); Print "</PRE>" ; Product :: Display (); Product : Show (); // Why can I access non-static methods in the following way? ?>
Class [class product] {@ D: \ webroot \ static. PHP 5-16-constants [0] {}-static properties [1] {property [public static $ count]}-static methods [1] {method [static public method display] {@ D: \ webroot \ static. PHP 13-15 }}- properties [1] {property [Public $ name]}-Methods [1] {method [public method show] {@ D: \ webroot \ static. php 9-11 }}}
Display static method
Show Method
The above isProgramIn the result of execution, the show method is a general method. Why can we use product: Show () for access without errors? Isn't the access from static methods the same? If so, what should I do with static methods? Which of the following gives me some advice. Thank you !!!