testing

testing

Packages to be installed before compile Apache 2.2.11 on Fedora 11

You need to install these packages with YUM first:

  1. yum install gcc gcc-c++
  2. yum install openssl openssl-devel
  3. yum install expat expat-devel

港產 Netbook,只售 HK$2,480!!

今天逛黃金時,無意中發現了一部港產 Netbook,可以擴充支援 3G,價錢竟然是 HK$2,480,看呆了。

More

Experiment: Pass by Reference in PHP, part 3

Code:


<?php
class Label {
    var 
$text;
    function 
Label($text) {
        
$this->text $text;
    }
}

$foo = new Label("foo");
$bar["foo"] = &$foo;
unset(
$foo);

var_dump($foo); print "<br/>\n";
var_dump($bar);
?>

More

Experiment: Pass by Reference in PHP, part 2

Code:


<?php

class testObj {
  private 
$flag=FALSE;

  public function 
set_flag() {
    
$this->flag TRUE;
  }

  public function 
get_flag() {
    return 
$this->flag;
  }
}

function 
test_container() {
  static 
$_test_obj;
  if (!isset(
$_test_obj)) $_test_obj = new testObj();
  return array(&
$_test_obj);
}


$array test_container();
$test_obj_1 $array[0];
$array test_container();
$test_obj_2 $array[0];

print 
sprintf("<li>object 1, before set flag: %s</li>\n",
  
var_export($test_obj_1->get_flag(), TRUE));?>

More

Experiment: Pass by Reference in PHP

Code:

<?php


class testObj {
  private 
$equals_inside=FALSE;

  public function 
set_equals_inside() {
    
$this->equals_inside TRUE;
  }

  public function 
equals_inside() {
    return 
$this->equals_inside;
  }
}

class 
testHandler {
  private 
$test_obj_inside;
  public function 
__construct($test_input) {
    
$this->test_obj_inside $test_input[0];
  }
  public function 
test_equals_inside() {
    return 
$this->test_obj_inside->equals_inside();
  }
  public function 
test_set_equals_inside() {
    
$this->test_obj_inside->set_equals_inside();
  }
}
?>

More