summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/test.php
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2013-12-20 14:27:51 +0100
committerBob Weinand <bobwei9@hotmail.com>2013-12-20 14:27:51 +0100
commitcee72c13d7defa8a51c33e2b6ed2c73d85fd4c2a (patch)
treec64561a3e7385a22ac6d416fb3252208b3a1392c /sapi/phpdbg/test.php
parent436ca2d019ed3ec3183129f9a3a7e329446077e9 (diff)
parentef3e0119b8437c855049ee3a67b0317dce055669 (diff)
downloadphp-git-cee72c13d7defa8a51c33e2b6ed2c73d85fd4c2a.tar.gz
Merge branch 'master' of sapi/phpdbg into PHP-5.6
Including phpdbg.
Diffstat (limited to 'sapi/phpdbg/test.php')
-rw-r--r--sapi/phpdbg/test.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/sapi/phpdbg/test.php b/sapi/phpdbg/test.php
new file mode 100644
index 0000000000..5fdbcbe1a4
--- /dev/null
+++ b/sapi/phpdbg/test.php
@@ -0,0 +1,51 @@
+<?php
+if (isset($include)) {
+ include (sprintf("%s/web-bootstrap.php", dirname(__FILE__)));
+}
+
+$stdout = fopen("php://stdout", "w+");
+
+class phpdbg {
+ public function isGreat($greeting = null) {
+ printf(
+ "%s: %s\n", __METHOD__, $greeting);
+ return $this;
+ }
+}
+
+function test($x, $y = 0) {
+ $var = $x + 1;
+ $var += 2;
+ $var <<= 3;
+
+ $foo = function () {
+ echo "bar!\n";
+ };
+
+ $foo();
+
+ yield $var;
+}
+
+$dbg = new phpdbg();
+
+var_dump(
+ $dbg->isGreat("PHP Rocks!!"));
+
+foreach (test(1,2) as $gen)
+ continue;
+
+echo "it works!\n";
+
+if (isset($dump))
+ var_dump($_SERVER);
+
+function phpdbg_test_ob()
+{
+ echo 'Start';
+ ob_start();
+ echo 'Hello';
+ $b = ob_get_clean();
+ echo 'End';
+ echo $b;
+}