Skip to content

Instantly share code, notes, and snippets.

@cjhanks
Created June 18, 2012 20:25
Show Gist options
  • Save cjhanks/2950501 to your computer and use it in GitHub Desktop.
Save cjhanks/2950501 to your computer and use it in GitHub Desktop.
Class Member Ref
<?php
class TestAchat
{
var $ref;
public function __construct(&$ref_val)
{
$this->ref = &$ref_val;
$this->ref = "words";
}
}
$var = "others";
echo "$var\n";
$test = new TestAchat(&$var);
echo "$var\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment