diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-21 23:29:25 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-21 23:30:08 +0200 |
| commit | 708af5fd8e3b279aa2f6343e369e26a67d8bedc1 (patch) | |
| tree | c3a3dc604892553cb5ad67bc6abcc15a50b189cc /sapi/phpdbg/test.php | |
| parent | 32d5f269a03b554a0d3ebc96fcacc842e3344e4e (diff) | |
| parent | 447ec05f3160628ef6dc7f7eee34bae866af8e5c (diff) | |
| download | php-git-708af5fd8e3b279aa2f6343e369e26a67d8bedc1.tar.gz | |
Merge sapi/phpdbg into PHP-5.6
Diffstat (limited to 'sapi/phpdbg/test.php')
| -rw-r--r-- | sapi/phpdbg/test.php | 46 |
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); |
