You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
612 B

27 years ago
  1. <?
  2. class foo {
  3. function foo() {
  4. print "foo()\n";
  5. }
  6. function bar(&$blah, $foobar=7) {
  7. $foobar += 19;
  8. }
  9. function hello_world() {
  10. return "Hello, World!";
  11. }
  12. function print_string($str) {
  13. print "$str\n";
  14. return 666;
  15. }
  16. var $foo;
  17. var $bar="this is a test...";
  18. };
  19. class bar {
  20. function foo($a,$b) {
  21. $a *= 3;
  22. return $a+$b;
  23. }
  24. function bar(&$blah, $foobar=7) {
  25. $foobar += 19;
  26. }
  27. var $foo;
  28. var $bar="this is a test...";
  29. };
  30. $b = new foo;
  31. $a = $b;
  32. print $a->print_string($a->hello_world())."\n";
  33. print $b->print_string($b->hello_world())."\n";
  34. $a->foo = 5;
  35. print $a->foo;
  36. print $a->foo();