Skip to content

Commit

Permalink
Remove call time pass by references -- fatal in PHP 5.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
convissor committed Jan 13, 2012
1 parent a6eeb2f commit 998f09e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Science/Chemistry/Molecule_XYZ.php
Expand Up @@ -77,7 +77,7 @@ function parseXYZ($xyzdata, $src) {
// first line is number of atoms
$this->num_atoms = trim($line[0]);
// second line is molecule name and energy
preg_match("/^([[:alnum:].]+)[[:space:]]+([[:digit:].-]+)/",trim($line[1]),&$re);
preg_match("/^([[:alnum:].]+)[[:space:]]+([[:digit:].-]+)/",trim($line[1]),$re);
$this->name = trim($re[1]);
$this->energy = trim($re[2]);
for ($i=2; $i<count($line); $i++) {
Expand Down
10 changes: 5 additions & 5 deletions Science/Chemistry/PDBParser.php
Expand Up @@ -110,7 +110,7 @@ function Science_Chemistry_PDBParser($filename, $multi=false, $meta=false, $full
$header_re = "/^HEADER[[:space:]]+(([^[:space:]]+ )+)[[:space:]]+";
$header_re .= "([0-9]{2}-[A-Z]{3}-[0-9]{2,4})[[:space:]]+[A-Z0-9]{4}/";

if (preg_match($header_re, $arr[0], &$regs)) {
if (preg_match($header_re, $arr[0], $regs)) {
$this->class = trim($regs[1]);
// put date in a more standard format
$tmp = explode("-", $regs[3]);
Expand All @@ -136,7 +136,7 @@ function Science_Chemistry_PDBParser($filename, $multi=false, $meta=false, $full
// of a model, if so, end parsing altogether
if ($rectype == "ENDMDL") {
if ($multi) {
$this->macromolecules[] = $this->parseResidues(&$tmparr, $full);
$this->macromolecules[] = $this->parseResidues($tmparr, $full);
$this->num_macromolecules++; // = count($this->macromolecules);
$tmparr = array();
} else {
Expand All @@ -152,7 +152,7 @@ function Science_Chemistry_PDBParser($filename, $multi=false, $meta=false, $full
$this->meta[$rectype][] = $arr[$i];
}
if (!empty($tmparr)) {
$this->macromolecules[] = $this->parseResidues(&$tmparr, $full);
$this->macromolecules[] = $this->parseResidues($tmparr, $full);
$this->num_macromolecules++; // = count($this->macromolecules);
}
}
Expand Down Expand Up @@ -190,7 +190,7 @@ function parseResidues($records, $full) {
) {
if (!empty($res_atoms)) {
for ($j=0; $j < count($res_atoms); $j++) {
$temp = $this->parseAtom($res_atoms[$j], $full, &$atomname);
$temp = $this->parseAtom($res_atoms[$j], $full, $atomname);
$residues[$curr_res_id][$atomname] = $temp;
}
}
Expand All @@ -208,7 +208,7 @@ function parseResidues($records, $full) {
* @param boolean $full whether to store the full set of fields per atom
* @see parseResidues()
*/
function parseAtom($atomrec, $full, &$atomname) {
function parseAtom($atomrec, $full, $atomname) {
$atom = array();
// process PDB atom record
// no error checking, assumes correct and standard record
Expand Down

0 comments on commit 998f09e

Please sign in to comment.