leledumbo wrote:
Good points, I'll try it.

Without testing it (it's late here), your binstr() function doesn't
accept parameters, so it would always return the same result each time
it's called, regardless of what you pass into it.

In case you want to check it tomorrow or later:

private function binstr() {
  $temp_bits = $this->bits;
  $str = "";
  for ($i=0;$i<32;$i++) {
    $str = strval($temp_bits & 1) . $str;
    $temp_bits >>= 1;
  return $str;

it doesn't accept parameters, but instead use private field $bits assigned
to $temp_bits (PHP manual states that it will be copied instead of
referenced, and it's exactly what I need).

but you're trying to pass stuff to it:

  public function tostring() {
    $str = $this->binstr($this->bits[0]);
    for ($i=1;$i<8;$i++)
      $str .= "," . $this->binstr($this->bits[$i]);
    return $str;

Postgresql & php tutorials

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to