2013-11-10 13:01:46 +00:00
|
|
|
<?php
|
2013-11-17 16:06:30 +00:00
|
|
|
if (isset($include))
|
2013-11-17 16:13:13 +00:00
|
|
|
include (sprintf("%s/web-bootstrap.php", dirname(__FILE__)));
|
2013-11-17 15:57:49 +00:00
|
|
|
|
2013-11-18 23:18:22 +00:00
|
|
|
$stdout = fopen("php://stdout", "w+");
|
|
|
|
|
2013-11-13 09:17:58 +00:00
|
|
|
class phpdbg {
|
|
|
|
public function isGreat($greeting = null) {
|
|
|
|
printf(
|
|
|
|
"%s: %s\n", __METHOD__, $greeting);
|
2013-11-12 00:27:48 +00:00
|
|
|
return $this;
|
|
|
|
}
|
2013-11-10 17:49:25 +00:00
|
|
|
}
|
2013-11-11 15:54:33 +00:00
|
|
|
|
2013-11-17 13:59:21 +00:00
|
|
|
function test() {
|
|
|
|
$var = 1 + 1;
|
|
|
|
$var += 2;
|
|
|
|
$var <<= 3;
|
|
|
|
|
|
|
|
$foo = function () {};
|
|
|
|
|
|
|
|
$foo();
|
|
|
|
|
2013-11-18 11:04:24 +00:00
|
|
|
yield $var;
|
2013-11-17 13:59:21 +00:00
|
|
|
}
|
|
|
|
|
2013-11-13 09:17:58 +00:00
|
|
|
$dbg = new phpdbg();
|
2013-11-12 15:10:29 +00:00
|
|
|
|
2013-11-13 09:17:58 +00:00
|
|
|
var_dump(
|
|
|
|
$dbg->isGreat("PHP Rocks !!"));
|
2013-11-17 13:59:21 +00:00
|
|
|
|
2013-11-18 10:32:33 +00:00
|
|
|
foreach (test() as $gen)
|
|
|
|
continue;
|
2013-11-17 13:59:21 +00:00
|
|
|
|
|
|
|
echo "it works!\n";
|
|
|
|
|
2013-11-17 16:06:30 +00:00
|
|
|
if (isset($dump))
|
|
|
|
var_dump($_SERVER);
|
2013-11-20 14:21:17 +00:00
|
|
|
|
2013-11-20 18:52:34 +00:00
|
|
|
function phpdbg_test_ob()
|
2013-11-20 14:21:17 +00:00
|
|
|
{
|
|
|
|
echo 'Start';
|
|
|
|
ob_start();
|
|
|
|
echo 'Hello';
|
|
|
|
$b = ob_get_clean();
|
|
|
|
echo 'End';
|
|
|
|
echo $b;
|
|
|
|
}
|
2013-11-20 18:52:34 +00:00
|
|
|
|
|
|
|
|
2013-11-10 13:01:46 +00:00
|
|
|
?>
|