This mapping has 1 multi-map group: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

Before

…lines 1–330 unchanged (330 lines)
331 $lines = $this->parsevmstat();
332 $nparams = count(preg_split("/\s/", $lines[1], -1, PREG_SPLIT_NO_EMPTY));
333 if ($nparams >= 19) {
334 $cpunr = 0;
335 $sum = 0;
336 $cpupl = ($nparams - 16) / 3;
337 for ($n = 2 ; $n < count($lines) ; $n++) {
338 $params = preg_split("/\s/", $lines[$n], -1, PREG_SPLIT_NO_EMPTY);
339 if ($params[$nparams - 1] > 100) break; //32-bit vmstat issue test
340 for ($p = 0 ; $p < $cpupl ; $p++) {
341 $val = 100 - $params[18 + 3*$p];
342 if ($val < 0) $val = 0;
343 elseif ($val > 100) $val = 100;
344 $this->_cpu_loads['cpu'.$cpunr] = $val;
345 $sum += $val;
346 $cpunr++;
347 }
…lines 348–958 unchanged (611 lines)

After

…lines 1–330 unchanged (330 lines)
331 $lines = $this->parsevmstat();
332 $nparams = count(preg_split("/\s/", $lines[1], -1, PREG_SPLIT_NO_EMPTY));
333 if ($nparams >= 19) {
334 $cpunr = 0;
335 $sum = 0;
336 $cpupl = ($nparams - 16) / 3;
337 $fix32 = false;
338 for ($n = 2 ; $n < count($lines) ; $n++) {
339 $params = preg_split("/\s/", $lines[$n], -1, PREG_SPLIT_NO_EMPTY);
340 if ($n == 2) $fix32 = $params[$nparams - 1] > 255; //32-bit vmstat issue test
341 for ($p = 0 ; $p < $cpupl ; $p++) {
342 if ($fix32) { //fix 32-bit vmstat issue
343 $valtmp = $params[18 + 3*$p];
344 $val = 100 + floor($valtmp / 256) * 256 - $valtmp;
345 } else {
346 $val = 100 - $params[18 + 3*$p];
347 }
348 if ($val < 0) $val = 0;
349 elseif ($val > 100) $val = 100;
350 $this->_cpu_loads['cpu'.$cpunr] = $val;
351 $sum += $val;
352 $cpunr++;
353 }
…lines 354–964 unchanged (611 lines)

Before

program
php_tag "<?php"
comment "/**\n * BSDCommon Class\n *\n * PHP version 5\n *\n * @category "...
comment "/**\n * BSDCommon class\n * get all the required information f"...
class_declaration
abstract_modifier
abstract "abstract"
class "class"
name "BSDCommon"
base_clause
extends "extends"
name "OS"
declaration_list
{ "{"
comment "/**\n * Assoc array of all CPUs loads.\n */"
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_cpu_loads"
= "="
null "null"
; ";"
comment "/**\n * content of the vmstat -P or vmstat\n *\n * "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_vmstat"
= "="
null "null"
; ";"
comment "/**\n * content of the syslog\n *\n * @var array\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_dmesg"
= "="
null "null"
; ";"
comment "/**\n * regexp1 for cpu information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_CPURegExp1"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp2 for cpu information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_CPURegExp2"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp1 for scsi information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_SCSIRegExp1"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp2 for scsi information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_SCSIRegExp2"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp3 for scsi information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_SCSIRegExp3"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp1 for pci information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_PCIRegExp1"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp1 for pci information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_PCIRegExp2"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * setter for cpuregexp1\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for cpuregexp2\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for scsiregexp1\n *\n * @param strin"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for scsiregexp2\n *\n * @param strin"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for scsiregexp3\n *\n * @param strin"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for pciregexp1\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for pciregexp2\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * execute vmstat -P or vmstat, but only if we haven"...
method_declaration (+210 nodes collapsed)
comment "/**\n * read /var/run/dmesg.boot, but only if we haven't "...
method_declaration (+233 nodes collapsed)
comment "/**\n * get a value from sysctl command\n *\n * @pa"...
method_declaration (+79 nodes collapsed)
comment "/**\n * Virtual Host Name\n *\n * @return void\n "...
method_declaration (+116 nodes collapsed)
comment "/**\n * Kernel Version\n *\n * @return void\n */"
method_declaration (+340 nodes collapsed)
comment "/**\n * Virtualizer info\n *\n * @return void\n "...
method_declaration (+203 nodes collapsed)
comment "/**\n * CPU usage\n *\n * @return void\n */"
method_declaration
visibility_modifier
protected "protected"
function "function"
name "cpuusage"
formal_parameters
( "("
simple_parameter
variable_name
$ "$"
name "cpuline"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
parenthesized_expression
( "("
binary_expression
member_access_expression
variable_name
$ "$"
name "this"
-> "->"
name "_cpu_loads"
=== "==="
null "null"
) ")"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
member_access_expression
variable_name
$ "$"
name "this"
-> "->"
name "_cpu_loads"
= "="
array_creation_expression
array "array"
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
name "PSI_OS"
== "=="
string
' "'"
string_content "Darwin"
' "'"
) ")"
compound_statement (+303 nodes collapsed)
else_clause
else "else"
compound_statement
{ "{"
expression_statement
assignment_expression
variable_name
$ "$"
name "notwas"
= "="
boolean "true"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
name "PSI_OS"
== "=="
string
' "'"
string_content "FreeBSD"
' "'"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
variable_name
$ "$"
name "lines"
= "="
member_call_expression
variable_name
$ "$"
name "this"
-> "->"
name "parsevmstat"
arguments
( "("
) ")"
; ";"
expression_statement (+40 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
variable_name
$ "$"
name "nparams"
>= ">="
integer "19"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
variable_name
$ "$"
name "cpunr"
= "="
integer "0"
; ";"
expression_statement
assignment_expression
variable_name
$ "$"
name "sum"
= "="
integer "0"
; ";"
expression_statement
assignment_expression
variable_name
$ "$"
name "cpupl"
= "="
binary_expression
parenthesized_expression
( "("
binary_expression
variable_name
$ "$"
name "nparams"
- "-"
integer "16"
) ")"
/ "/"
integer "3"
; ";"
for_statement
for "for"
( "("
assignment_expression
variable_name
$ "$"
name "n"
= "="
integer "2"
; ";"
binary_expression
variable_name
$ "$"
name "n"
< "<"
function_call_expression
name "count"
arguments
( "("
argument
variable_name
$ "$"
name "lines"
) ")"
; ";"
update_expression
variable_name
$ "$"
name "n"
++ "++"
) ")"
compound_statement
{ "{"
expression_statement (+36 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression any 1:2
subscript_expression
variable_name
$ "$"
name "params"
[ "["
binary_expression
variable_name
$ "$"
name "nparams"
- "-"
integer "1"
] "]"
> ">"
integer "100"
) ")"
break_statement
break "break"
; ";"
comment "//32-bit vmstat issue test"
for_statement
for "for"
( "("
assignment_expression
variable_name
$ "$"
name "p"
= "="
integer "0"
; ";"
binary_expression
variable_name
$ "$"
name "p"
< "<"
variable_name
$ "$"
name "cpupl"
; ";"
update_expression
variable_name
$ "$"
name "p"
++ "++"
) ")"
compound_statement
{ "{"
expression_statement (+25 nodes collapsed)
if_statement (+38 nodes collapsed)
expression_statement (+25 nodes collapsed)
expression_statement
augmented_assignment_expression
variable_name
$ "$"
name "sum"
+= "+="
variable_name
$ "$"
name "val"
; ";"
expression_statement
update_expression
variable_name
$ "$"
name "cpunr"
++ "++"
; ";"
} "}"
} "}"
if_statement (+47 nodes collapsed)
} "}"
} "}"
if_statement (+427 nodes collapsed)
} "}"
} "}"
if_statement (+50 nodes collapsed)
} "}"
comment "/**\n * Processor Load\n * optionally create a loadbar"...
method_declaration (+170 nodes collapsed)
comment "/**\n * CPU information\n *\n * @return void\n *"...
method_declaration (+1079 nodes collapsed)
comment "/**\n * Machine information\n *\n * @return void\n "...
method_declaration (+1542 nodes collapsed)
comment "/**\n * SCSI devices\n * get the scsi device informati"...
method_declaration (+1104 nodes collapsed)
comment "/**\n * parsing the output of pciconf command\n *\n "...
method_declaration (+561 nodes collapsed)
comment "/**\n * PCI devices\n * get the pci device information"...
method_declaration (+325 nodes collapsed)
comment "/**\n * IDE devices\n * get the ide device information"...
method_declaration (+1079 nodes collapsed)
comment "/**\n * Physical memory information and Swap Space inform"...
method_declaration (+705 nodes collapsed)
comment "/**\n * USB devices\n * get the ide device information"...
method_declaration (+304 nodes collapsed)
comment "/**\n * filesystem information\n *\n * @return void"...
method_declaration (+57 nodes collapsed)
comment "/**\n * Distribution\n *\n * @return void\n */"
method_declaration (+63 nodes collapsed)
comment "/**\n * UpTime\n * time the system is running\n *\n "...
method_declaration (+216 nodes collapsed)
comment "/**\n * get the information\n *\n * @see PSI_Interf"...
method_declaration (+296 nodes collapsed)
} "}"

After

program
php_tag "<?php"
comment "/**\n * BSDCommon Class\n *\n * PHP version 5\n *\n * @category "...
comment "/**\n * BSDCommon class\n * get all the required information f"...
class_declaration
abstract_modifier
abstract "abstract"
class "class"
name "BSDCommon"
base_clause
extends "extends"
name "OS"
declaration_list
{ "{"
comment "/**\n * Assoc array of all CPUs loads.\n */"
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_cpu_loads"
= "="
null "null"
; ";"
comment "/**\n * content of the vmstat -P or vmstat\n *\n * "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_vmstat"
= "="
null "null"
; ";"
comment "/**\n * content of the syslog\n *\n * @var array\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_dmesg"
= "="
null "null"
; ";"
comment "/**\n * regexp1 for cpu information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_CPURegExp1"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp2 for cpu information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_CPURegExp2"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp1 for scsi information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_SCSIRegExp1"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp2 for scsi information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_SCSIRegExp2"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp3 for scsi information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_SCSIRegExp3"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp1 for pci information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_PCIRegExp1"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * regexp1 for pci information out of the syslog\n "...
property_declaration
visibility_modifier
private "private"
property_element
variable_name
$ "$"
name "_PCIRegExp2"
= "="
encapsed_string
" "\""
string_content "//"
" "\""
; ";"
comment "/**\n * setter for cpuregexp1\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for cpuregexp2\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for scsiregexp1\n *\n * @param strin"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for scsiregexp2\n *\n * @param strin"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for scsiregexp3\n *\n * @param strin"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for pciregexp1\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * setter for pciregexp2\n *\n * @param string"...
method_declaration (+28 nodes collapsed)
comment "/**\n * execute vmstat -P or vmstat, but only if we haven"...
method_declaration (+210 nodes collapsed)
comment "/**\n * read /var/run/dmesg.boot, but only if we haven't "...
method_declaration (+233 nodes collapsed)
comment "/**\n * get a value from sysctl command\n *\n * @pa"...
method_declaration (+79 nodes collapsed)
comment "/**\n * Virtual Host Name\n *\n * @return void\n "...
method_declaration (+116 nodes collapsed)
comment "/**\n * Kernel Version\n *\n * @return void\n */"
method_declaration (+340 nodes collapsed)
comment "/**\n * Virtualizer info\n *\n * @return void\n "...
method_declaration (+203 nodes collapsed)
comment "/**\n * CPU usage\n *\n * @return void\n */"
method_declaration
visibility_modifier
protected "protected"
function "function"
name "cpuusage"
formal_parameters
( "("
simple_parameter
variable_name
$ "$"
name "cpuline"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
parenthesized_expression
( "("
binary_expression
member_access_expression
variable_name
$ "$"
name "this"
-> "->"
name "_cpu_loads"
=== "==="
null "null"
) ")"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
member_access_expression
variable_name
$ "$"
name "this"
-> "->"
name "_cpu_loads"
= "="
array_creation_expression
array "array"
( "("
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
name "PSI_OS"
== "=="
string
' "'"
string_content "Darwin"
' "'"
) ")"
compound_statement (+303 nodes collapsed)
else_clause
else "else"
compound_statement
{ "{"
expression_statement
assignment_expression
variable_name
$ "$"
name "notwas"
= "="
boolean "true"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
name "PSI_OS"
== "=="
string
' "'"
string_content "FreeBSD"
' "'"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
variable_name
$ "$"
name "lines"
= "="
member_call_expression
variable_name
$ "$"
name "this"
-> "->"
name "parsevmstat"
arguments
( "("
) ")"
; ";"
expression_statement (+40 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
variable_name
$ "$"
name "nparams"
>= ">="
integer "19"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
variable_name
$ "$"
name "cpunr"
= "="
integer "0"
; ";"
expression_statement
assignment_expression
variable_name
$ "$"
name "sum"
= "="
integer "0"
; ";"
expression_statement
assignment_expression
variable_name
$ "$"
name "cpupl"
= "="
binary_expression
parenthesized_expression
( "("
binary_expression
variable_name
$ "$"
name "nparams"
- "-"
integer "16"
) ")"
/ "/"
integer "3"
; ";"
expression_statement
assignment_expression
variable_name
$ "$"
name "fix32"
= "="
boolean "false"
; ";"
for_statement
for "for"
( "("
assignment_expression
variable_name
$ "$"
name "n"
= "="
integer "2"
; ";"
binary_expression
variable_name
$ "$"
name "n"
< "<"
function_call_expression
name "count"
arguments
( "("
argument
variable_name
$ "$"
name "lines"
) ")"
; ";"
update_expression
variable_name
$ "$"
name "n"
++ "++"
) ")"
compound_statement
{ "{"
expression_statement (+36 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression any 1:2
variable_name
$ "$"
name "n"
== "=="
integer "2"
) ")"
expression_statement
assignment_expression
variable_name
$ "$"
name "fix32"
= "="
binary_expression any 1:2
subscript_expression
variable_name
$ "$"
name "params"
[ "["
binary_expression
variable_name
$ "$"
name "nparams"
- "-"
integer "1"
] "]"
> ">"
integer "255"
; ";"
comment "//32-bit vmstat issue test"
for_statement
for "for"
( "("
assignment_expression
variable_name
$ "$"
name "p"
= "="
integer "0"
; ";"
binary_expression
variable_name
$ "$"
name "p"
< "<"
variable_name
$ "$"
name "cpupl"
; ";"
update_expression
variable_name
$ "$"
name "p"
++ "++"
) ")"
compound_statement
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
variable_name
$ "$"
name "fix32"
) ")"
compound_statement
{ "{"
comment "//fix 32-bit vmstat issue"
expression_statement
assignment_expression
variable_name
$ "$"
name "valtmp"
= "="
subscript_expression
variable_name
$ "$"
name "params"
[ "["
binary_expression
integer "18"
+ "+"
binary_expression
integer "3"
* "*"
variable_name
$ "$"
name "p"
] "]"
; ";"
expression_statement
assignment_expression
variable_name
$ "$"
name "val"
= "="
binary_expression
binary_expression
integer "100"
+ "+"
binary_expression
function_call_expression
name "floor"
arguments
( "("
argument
binary_expression
variable_name
$ "$"
name "valtmp"
/ "/"
integer "256"
) ")"
* "*"
integer "256"
- "-"
variable_name
$ "$"
name "valtmp"
; ";"
} "}"
else_clause
else "else"
compound_statement
{ "{"
expression_statement (+25 nodes collapsed)
} "}"
if_statement (+38 nodes collapsed)
expression_statement (+25 nodes collapsed)
expression_statement
augmented_assignment_expression
variable_name
$ "$"
name "sum"
+= "+="
variable_name
$ "$"
name "val"
; ";"
expression_statement
update_expression
variable_name
$ "$"
name "cpunr"
++ "++"
; ";"
} "}"
} "}"
if_statement (+47 nodes collapsed)
} "}"
} "}"
if_statement (+427 nodes collapsed)
} "}"
} "}"
if_statement (+50 nodes collapsed)
} "}"
comment "/**\n * Processor Load\n * optionally create a loadbar"...
method_declaration (+170 nodes collapsed)
comment "/**\n * CPU information\n *\n * @return void\n *"...
method_declaration (+1079 nodes collapsed)
comment "/**\n * Machine information\n *\n * @return void\n "...
method_declaration (+1542 nodes collapsed)
comment "/**\n * SCSI devices\n * get the scsi device informati"...
method_declaration (+1104 nodes collapsed)
comment "/**\n * parsing the output of pciconf command\n *\n "...
method_declaration (+561 nodes collapsed)
comment "/**\n * PCI devices\n * get the pci device information"...
method_declaration (+325 nodes collapsed)
comment "/**\n * IDE devices\n * get the ide device information"...
method_declaration (+1079 nodes collapsed)
comment "/**\n * Physical memory information and Swap Space inform"...
method_declaration (+705 nodes collapsed)
comment "/**\n * USB devices\n * get the ide device information"...
method_declaration (+304 nodes collapsed)
comment "/**\n * filesystem information\n *\n * @return void"...
method_declaration (+57 nodes collapsed)
comment "/**\n * Distribution\n *\n * @return void\n */"
method_declaration (+63 nodes collapsed)
comment "/**\n * UpTime\n * time the system is running\n *\n "...
method_declaration (+216 nodes collapsed)
comment "/**\n * get the information\n *\n * @see PSI_Interf"...
method_declaration (+296 nodes collapsed)
} "}"