Skip to content

Instantly share code, notes, and snippets.

@polidog
Created March 19, 2014 10:26
Show Gist options
  • Save polidog/9639081 to your computer and use it in GitHub Desktop.
Save polidog/9639081 to your computer and use it in GitHub Desktop.
<?php
class DataObject
{
public $a;
public $b;
public function __toString()
{
return (string)$this->a . ','. $this->b;
}
}
function test($object) {
$object->b = "c";
}
$object = new DataObject();
$object->a = "a";
$object->b = "b";
test($object);
echo $object;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment