<?php
class Foo {
public $first;
public $second;
public static
$array = array();
public function __construct($first, $second) {
$this->first = $first;
$this->second = $second;
self::$array[] = $this;
}
}
$first = new Foo('first', 'first');
$second = new Foo('second', 'second');
PD9waHAKY2xhc3MgRm9vIHsKCXB1YmxpYyAkZmlyc3Q7CglwdWJsaWMgJHNlY29uZDsKCQoJcHVibGljIHN0YXRpYyAkYXJyYXkgPSBhcnJheSgpOwoJCglwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoJGZpcnN0LCAkc2Vjb25kKSB7CgkJJHRoaXMtPmZpcnN0ID0gJGZpcnN0OwoJCSR0aGlzLT5zZWNvbmQgPSAkc2Vjb25kOwoJCQoJCXNlbGY6OiRhcnJheVtdID0gJHRoaXM7Cgl9Cn0KCiRmaXJzdCA9IG5ldyBGb28oJ2ZpcnN0JywgJ2ZpcnN0Jyk7CiRzZWNvbmQgPSBuZXcgRm9vKCdzZWNvbmQnLCAnc2Vjb25kJyk7CgpwcmludF9yKEZvbzo6JGFycmF5KTs=