Archive for March, 2006

Pass by Reference in PHP5

Thursday, March 30th, 2006

PHP5 has a Pass-by-reference notation: &$bar in line 3 as seen here in the parameter to a function bar(); Basically, this is just a point from the sub routine’s “$bar” back to the caller’s $foo. In this case, a change to the reference variable $bar is reflected in the main variable $foo.

“bar points to/references foo”
$bar => $foo;


1< ?
2 //pass by reference...
3 function bar(&$bar = NULL)
4 {
5 print "\tbar:" . $bar . "\n";
6 $bar = 'bar';
7 print "\tbar:" . $bar . "\n";
8 }
9
10 $foo = 'foo';
11 print "foo:" . $foo . "\n";
12 bar($foo);
13 print "foo:" . $foo . "\n";
14
15
16 ?>

Output:


foo:foo
bar:foo
bar:bar
foo:bar

Recommended reading: PHP 5 Objects, Patterns, and Practice

VN:F [1.8.4_1055]
Rating: 8.0/10 (1 vote cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)

Firewall Encryption

Thursday, March 23rd, 2006

A topic of interest for me lately, seeing as how I’m protecting data on my server, I want to make sure that I encrypt traffic between two locations…something I’m going to start reading about after I finish reading the Software Configuration Management Strategies and Rational ClearCase: A Practical Introduction book.

Firewall Encryption

VN:F [1.8.4_1055]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)