Skip to content

Instantly share code, notes, and snippets.

@nikic

nikic/repro.php Secret

Created September 5, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikic/7657d8b1eb6956b61674 to your computer and use it in GitHub Desktop.
Save nikic/7657d8b1eb6956b61674 to your computer and use it in GitHub Desktop.
<?php
class Wrapper {
public $worker;
public function __construct() {
$this->worker = new Worker;
$this->worker->start();
}
public function stack(Collectable $work) {
$this->worker->stack($work);
}
}
class Work extends Collectable {
public $wrapper;
public function __construct(Wrapper $wrapper) {
$this->wrapper = $wrapper;
}
public function stack() {
$this->wrapper->stack($this);
}
public function run() {
echo "Foo\n";
}
}
$wrapper = new Wrapper;
$work = new Work($wrapper);
$work->stack();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment