summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/test.php
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg/test.php')
-rw-r--r--sapi/phpdbg/test.php46
1 files changed, 41 insertions, 5 deletions
diff --git a/sapi/phpdbg/test.php b/sapi/phpdbg/test.php
index 5fdbcbe1a4..d93c81a89a 100644
--- a/sapi/phpdbg/test.php
+++ b/sapi/phpdbg/test.php
@@ -6,11 +6,16 @@ if (isset($include)) {
$stdout = fopen("php://stdout", "w+");
class phpdbg {
- public function isGreat($greeting = null) {
- printf(
- "%s: %s\n", __METHOD__, $greeting);
- return $this;
- }
+ private $sprintf = "%s: %s\n";
+
+ public function isGreat($greeting = null) {
+ printf($this->sprintf, __METHOD__, $greeting);
+ return $this;
+ }
+}
+
+function mine() {
+ var_dump(func_get_args());
}
function test($x, $y = 0) {
@@ -49,3 +54,34 @@ function phpdbg_test_ob()
echo 'End';
echo $b;
}
+
+$array = [
+ 1,
+ 2,
+ [3, 4],
+ [5, 6],
+];
+
+$array[] = 7;
+
+array_walk($array, function (&$item) {
+ if (is_array($item))
+ $item[0] += 2;
+ else
+ $item -= 1;
+});
+
+class testClass {
+ public $a = 2;
+ protected $b = [1, 3];
+ private $c = 7;
+}
+
+$obj = new testClass;
+
+$test = $obj->a;
+
+$obj->a += 2;
+$test -= 2;
+
+unset($obj);