Sorry, was no way to attach zip. Here are example files:
a.php:
"""
<?php
require_once("b.php");
?>
<html>
<body>
qzna!
</body>
</html>
"""
b.php
"""
<?php
require_once("c.php");
?>
"""
c.php
"""
<?php
function a()
{
Header("Content-type: text/html");
Header("Cache-Control: no-cache, must-revalidate");
Header("Pragma: no-cache");
}
function b($a,$b)
{
echo "<a href=\"$a\">$b</a>";
}
function c($input)
{
$input = str_replace(array("&","""), array("&","'"), $input);
$input = htmlspecialchars($input);
$output = "";
for ($i=0;$i<strlen($input);$i++)
{
$c = $input{$i};
if (ord($c) > 127)
{
$output .= "&#" . ord($c) . ";";
}
elseif ($c == "$")
{
$output .= "$$";
}
else
{
$output .= $c;
}
}
return $output;
}
function d($input)
{
$output = "";
for ($i=0;$i<strlen($input);$i++)
{
if (ereg("[[:alnum:]., '()?-]",$input{$i}))
{
$output .= $input{$i};
}
}
return $output;
}
function br()
{
return "<br />\n";
}
function e($name, $value, $options)
{
$element = "<select name=\"$name\" value=\"$value\">\n";
while (list($key, $val) = each($options))
{
$element .= " <option value=\"$key\">$val</option>\n";
}
$element .= "</select>";
return $element;
}
function f($text, $key, $value=NULL)
{
if ($value === NULL)
{
return "$text<input name=\"$key\"/>";
}
else
{
return "$text<input name=\"$key\" value=\"$value\"/>";
}
}
function g($text, $img = "")
{
if (isset($_SESSION['user']))
{
$dir = $_SESSION['user']->theme;
$display = ($dir != "off" and $dir != "");
}
else
{
$dir = "default";
$display = true;
}
if ($img == "")
$img = strtolower($text);
if ($display)
return "<img alt=\"$text\" src=\"./theme/$dir/$img.gif\"/>";
else
return "$text";
}
function h($url, $text, $postfield = NULL, $setvar = NULL, $method = "get")
{
$element = "";
if ($method == "get")
{
if ($setvar === NULL)
{
$element .= "<a href=\"$url";
if ($postfield !== NULL)
{
$first = true;
reset($postfield);
while (list($key, $val) = each($postfield))
{
if ($first)
{
$first = false;
$element .= "?";
}
else
{
$element .= "&";
}
$element .= "$key=$val";
}
}
$element .= "\">$text</a>";
}
else
{
$element .= "<anchor>$text<go href=\"$url";
if (trim(session_id())!="" AND trim(session_id())!="deleted")
$postfield["PHPSESSID"] = session_id();
if ($postfield !== NULL)
{
$first = true;
reset($postfield);
while (list($key, $val) = each($postfield))
{
if ($first)
{
$first = false;
$element .= "?";
}
else
{
$element .= "&";
}
$element .= "$key=$val";
}
}
$element .= "\" method=\"get\">\n";
reset($setvar);
while (list($key, $val) = each($setvar))
{
$element .= " <setvar name=\"$key\" value=\"$val\"/>\n";
}
$element .= "</go></anchor>";
}
}
elseif ($method = "post")
{
if ($setvar === NULL)
{
if (trim(session_id())!="" AND trim(session_id())!="deleted")
$postfield["PHPSESSID"] = session_id();
if ($postfield === NULL)
{
$element .= "<a href=\"$url\">$text</a>";
}
else
{
$element .= "<anchor>$text<go href=\"$url\" method=\"post\">\n";
reset($postfield);
while (list($key, $val) = each($postfield))
{
$element .= " <postfield name=\"$key\" value=\"$val\"/>\n";
}
$element .= "</go></anchor>";
}
}
else
{
$element .= "<anchor>$text<go href=\"$url\" method=\"post\">\n";
if (trim(session_id())!="" AND trim(session_id())!="deleted")
$postfield["PHPSESSID"] = session_id();
reset($postfield);
while (list($key, $val) = each($postfield))
{
$element .= " <postfield name=\"$key\" value=\"$val\"/>\n";
}
reset($setvar);
while (list($key, $val) = each($setvar))
{
$element .= " <setvar name=\"$key\" value=\"$val\"/>\n";
}
$element .= "</go></anchor>";
}
}
return $element;
}
function i($code, $heading, $feed)
{
echo g("headlines.php",$heading,array("code"=>$code,"feed"=>$feed),NULL,"post") . br();
}
function j($haystack, $char_list)
{
if (!is_scalar($haystack)) {
user_error('strpbrk() expects parameter 1 to be string, ' .
gettype($haystack) . ' given', E_USER_WARNING);
return false;
}
if (!is_scalar($char_list)) {
user_error('strpbrk() expects parameter 2 to be scalar, ' .
gettype($needle) . ' given', E_USER_WARNING);
return false;
}
$haystack = (string) $haystack;
$char_list = (string) $char_list;
$len = strlen($haystack);
for ($i = 0; $i < $len; $i++) {
$char = substr($haystack, $i, 1);
if (strpos($char_list, $char) === false) {
continue;
}
return substr($haystack, $i);
}
return false;
}
?>
"""
cachegrind.out.1398746969:
"""
version: 0.9.6
cmd: C:\Inetpub\waproot\test\a.php
part: 1
events: Time
fl=C:\Inetpub\waproot\test\c.php
fn=require_once::C:\Inetpub\waproot\test\c.php
1 240
fl=C:\Inetpub\waproot\test\b.php
fn=require_once::C:\Inetpub\waproot\test\b.php
1 19378
cfn=require_once::C:\Inetpub\waproot\test\c.php
calls=1 0 0
2 240
fl=C:\Inetpub\waproot\test\a.php
fn={main}
summary: 25269
0 5650
cfn=require_once::C:\Inetpub\waproot\test\b.php
calls=1 0 0
2 19619
""" |