Skip to content

Instantly share code, notes, and snippets.

@shin1x1
Created November 19, 2010 00:42
Show Gist options
  • Save shin1x1/705963 to your computer and use it in GitHub Desktop.
Save shin1x1/705963 to your computer and use it in GitHub Desktop.
<?php
class Foo {
public $var1 = '';
protected $var2 = '';
private $var3 = '';
public function setVars($var1, $var2, $var3) {
$this->var1 = $var1;
$this->var2 = $var2;
$this->var3 = $var3;
}
}
$obj = new Foo();
$obj->setVars('public', 'protected', 'private');
var_dump(unserialize(serialize($obj)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment