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.

51 lines
720 B

13 years ago
  1. <?php
  2. if (isset($include)) {
  3. include (sprintf("%s/web-bootstrap.php", dirname(__FILE__)));
  4. }
  5. $stdout = fopen("php://stdout", "w+");
  6. class phpdbg {
  7. public function isGreat($greeting = null) {
  8. printf(
  9. "%s: %s\n", __METHOD__, $greeting);
  10. return $this;
  11. }
  12. }
  13. function test($x, $y = 0) {
  14. $var = $x + 1;
  15. $var += 2;
  16. $var <<= 3;
  17. $foo = function () {
  18. echo "bar!\n";
  19. };
  20. $foo();
  21. yield $var;
  22. }
  23. $dbg = new phpdbg();
  24. var_dump(
  25. $dbg->isGreat("PHP Rocks!!"));
  26. foreach (test(1,2) as $gen)
  27. continue;
  28. echo "it works!\n";
  29. if (isset($dump))
  30. var_dump($_SERVER);
  31. function phpdbg_test_ob()
  32. {
  33. echo 'Start';
  34. ob_start();
  35. echo 'Hello';
  36. $b = ob_get_clean();
  37. echo 'End';
  38. echo $b;
  39. }