Skip to content

Instantly share code, notes, and snippets.

@pierrejoye
Created July 28, 2011 07:27
Show Gist options
  • Select an option

  • Save pierrejoye/1111149 to your computer and use it in GitHub Desktop.

Select an option

Save pierrejoye/1111149 to your computer and use it in GitHub Desktop.
oopsie
<?php
class Foo {
var $foo;#, $bar;
function __construct(){
$this->foo = '';
$this->bar =& $this->foo;
}
function dump(){
var_dump($this->foo);
var_dump($this->bar);
}
function a($t){
#nothing here
}
}
$f = new Foo();
$f->dump();
$f->bar .= 'bar';
$f->dump();
$f->foo .= 'foo';
$f->dump();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment