global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / methodcache_private_public.php
blob8ff7313435f05bc4819ac3d94515cc8ebdb874b1
1 <?hh
3 class one {
4 public function doit($o) {
5 // Method cache should still dispatch to one::heh for $o :: two
6 $o->heh();
9 private function heh() {
10 echo "one\n";
14 class two extends one {
15 // You can override a private function with a public one in php.
16 // (But you can't change it to static.)
17 public function heh() {
18 echo "two\n";
22 function main() {
23 $one = new one;
24 $two = new two;
25 $one->doit($one);
26 $one->doit($two);
27 $one->doit($two);
28 $one->doit($one);
29 $one->doit($one);
30 $one->doit($two);
31 $one->doit($two);
33 main();