<?php class X { static function bar($x) { echo "X::bar() with x = $x\n"; } } class Y extends X { static function bar() { echo "Y::bar()\n"; } } echo "Static dispatch:\n"; X::bar(1); Y::bar(); echo "Dynamic dispatch of a static method (surprise!):\n"; $arr = array(new X(), new Y()); foreach ($arr as $a) { $a::bar(1); }
You have javascript disabled. You will not be able to edit any code.
There are `0` results