hiphop-php /hphp/test/quick/autoload6.php

Language PHP Lines 33
MD5 Hash b3a4f9b8c29fa73e798d359c9f50a51f Estimated Cost $656 (why?)
Repository git://github.com/facebook/hiphop-php.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
function my_autoload_func1($cls) {
  echo "my_autoload_func1 $cls\n";
}
function my_autoload_func2($cls) {
  echo "my_autoload_func2 $cls\n";
  $cls = strtolower($cls);
  if ($cls === 'i') {
    interface I {
      public function foo();
    }
  }
}
function my_autoload_func3($cls) {
  echo "my_autoload_func3 $cls\n";
  $cls = strtolower($cls);
  if ($cls === 'i') {
    interface I {
      public function bar();
    }
  }
}

class C { function __toString() { return 'I'; } }

function main() {
  spl_autoload_register('my_autoload_func1');
  spl_autoload_register('my_autoload_func2');
  spl_autoload_register('my_autoload_func3');
  var_dump(interface_exists(new C));
}
main();
Back to Top