Chovy’s Blog

Pass by Reference in PHP5

Thu, March 30, 2006 — Category: Open Source, Development

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 […]

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

  • Post Pass by Reference in PHP5 to del.icio.us
  • Post Pass by Reference in PHP5 to digg
  • Post Pass by Reference in PHP5 to Furl
  • Add Pass by Reference in PHP5 to YahooMyWeb
  • Simpify!
  • Post Pass by Reference in PHP5 to shadows
  • Post Pass by Reference in PHP5 to Spurl
  • Post Pass by Reference in PHP5 to BuddyMarks
  • Submit Pass by Reference in PHP5 to Slashdot

Firewall Encryption

Thu, March 23, 2006 — Category: Personal

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.

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

  • Post Firewall Encryption to del.icio.us
  • Post Firewall Encryption to digg
  • Post Firewall Encryption to Furl
  • Add Firewall Encryption to YahooMyWeb
  • Simpify!
  • Post Firewall Encryption to shadows
  • Post Firewall Encryption to Spurl
  • Post Firewall Encryption to BuddyMarks
  • Submit Firewall Encryption to Slashdot
 
Keyword Advertisers:
SEO Directory SEO Links Free Link Directory Shopping Submission Directory Gardening Tips Political Forum Search Engine Optimization Search Engine Marketing Audio Video Directory SEO Forum Web Development Blog Organic SEO Wiki Web Development Consulting

Learn more about purchasing keyword text link ads on this site.