Fixed, but if you have better ideas feel free to share them. My ideas when i worked on this:

First:
```php
<?php

// this one won't work since there is no way to pass $_items by reference
// to register_shutdown_function's closure

class Test
{
	private $_items = array();
	
	public function __construct()
	{
		register_shutdown_function(function($items) {
			var_dump($items);
		}, $this->_items);
	}
	
	public function insertItem()
	{
		$this->_items[] = mt_rand(1, 10);
	}
}

$test = new Test();
for ($i = 0; $i < 3; $i++) {
	$test->insertItem();
}
```

Second:
```php
<?php

// this one is much worse since we're exposing important data

class Test
{
	public $_items = array();
	
	public function __construct()
	{
		register_shutdown_function(function($object) {
			var_dump($object->_items);
		}, $this);
	}
	
	public function insertItem()
	{
		$this->_items[] = mt_rand(1, 10);
	}
}

$test = new Test();
for ($i = 0; $i < 3; $i++) {
	$test->insertItem();
}
```

Third (implemented):
```php
<?php

// this one looks much better

class Test
{
	private $_items = array();
	
	public function __construct()
	{
		$reference = new stdClass();
		$reference->items = &$this->_items;
		register_shutdown_function(function($ref) {
			var_dump($ref->items);
		}, $reference);
	}
	
	public function insertItem()
	{
		$this->_items[] = mt_rand(1, 10);
	}
}

$test = new Test();
for ($i = 0; $i < 3; $i++) {
	$test->insertItem();
}
```