function ss() { $v = ii(); ff($v); $z = "zz"; //z(); $z(); }
if (mf($f, $m)) { e("\nAnalyzing %s\n", basename($f)); printf("<h1 id=\"%s\">%s</h1>\n", basename($f), basename($f)); foreach ($m[1] as $i => $p) { e("Documenting {$p}\n"); if ($o = preg_match('/^(.*), (.*)$/', $m[4][$i], $n)) { if ($n[2] == '__construct') { printf("<h2 id=\"%s\" class=\"o\">%s</h2>\n", $n[1], $n[1]); } $TOC[basename($f)][$n[1]][$n[2]] = $n[1] . '::' . $n[2] . '()'; printf("<h%d id=\"%s\">%s</h%d>\n", 3, $n[1] . '_' . $n[2], $p, 3); } else { $TOC[basename($f)][$m[4][$i]] = $m[4][$i] . '()'; printf("<h%d id=\"%s\">%s</h%d>\n", 2, $m[4][$i], $p, 2); } print ff($m[3][$i]) . "\n"; } print "<hr noshade>\n"; } } } printf("<div class=\"toc\"><strong>Table of Contents</strong>\n<ul>\n"); foreach ($TOC as $file => $f) { printf("<li><a href=\"#%s\">%s\n<ul>\n", $file, $file); foreach ($f as $cof => $met) { if (is_array($met)) { foreach ($met as $id => $m) { printf("<li><a href=\"#%s_%s\">%s</a></li>\n", $cof, $id, $m); } } else { printf("<li><a href=\"#%s\">%s</a>\n", $cof, $cof);
class c1 { public static function a($a, $aa) { $c = array($aa => $a, 'abcd' => $aa + $a); witness_dump('abcdefg'); $d = $aa - $a; return $c; } } function f1($a, $b) { $d = c1::a(5, $a + $b); $a = $a + $d['abcd']; echo f2($a + $b, $a * $b) . "\n"; } function f2($a, $b) { echo $a * $b . "\n"; return json_encode(c1::a($a, $b)); } function ff() { witness_start('abc'); return 1; } echo "abc\n"; ff(); echo f1(5, 6) . "\n"; echo "123\n"; f1(5, 10);
$c1 = new C1(); $c1->pr2 = 'v'; var_dump($c1->pr2); var_dump($c1); ${$c1}->pr2 = 6; // $w => stdClass { ["pr2"]=>int(6) } //var_dump($GLOBALS); ${$c1}->pr2 = 7; // $w => stdClass { ["pr2"]=>int(7) } //var_dump($GLOBALS); // The 2 cases above are equivalent. Here's what's happening: // $c1 is converted to a string via __toString, which gives 'w'. // The designated variable becomes $w, which does not exist, so it looks like // it has a value of NULL. Then, when the -> is applied, we get a instance of stdClass. // The problem then is that the $ operator takes precedence over the ->, which wasn't // what I expected. ${$c1->pr2} = 8; // $v = 8 //var_dump($GLOBALS); unset($v, $w); //*/ ///* echo "----------------------\n"; function ff() { return "xxx"; } $res = ff(); ${$res} = 777; echo "\$xxx = {$xxx}\n"; //*/
function ff_password($v = "") { return ff("FPassword", "password", $v, "password", "", "size='30'"); }
<?php //define type in comment const CON_NO = "sss"; /** @var $tb Test\Testb */ $v = $tb->get_v2()->v1; $ta = new \Test\Testa(); $ta->set_v1("ss"); $f = ff(); $v = $tb->get_v2("ss"); $k = $tb->get_v2()->v1; function kk() { } /** resource */ function xml_parser_create(string $encoding = "11", int $a) { }
function unpack1($t) { for ($i = 0; $i < strlen($t);) { if (ord($t[$i]) < 128) { echo 'pass ' . ord($t[$i]) . ' "' . ff(substr($t, $i + 1, ord($t[$i]))) . '"' . "\n"; $i += 1 + ord($t[$i]); } else { echo 'copy ' . (256 - ord($t[$i])) . ' "' . ff($t[$i + 1]) . '"' . "\n"; $i += 2; } } }