Skip to content

Instantly share code, notes, and snippets.

@nikic

nikic/foo.php Secret

Created September 25, 2013 11:12
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/b8fa227ae2f7df2ec916 to your computer and use it in GitHub Desktop.
Save nikic/b8fa227ae2f7df2ec916 to your computer and use it in GitHub Desktop.
<?php
/** @private */
class _LinkedListNode {
private $value;
private $next;
public function __construct($this->value, _LinkedListNode $this->next = null);
}
class LinkedList {
private function makeNode($value, $next) {
return new class {
private $value;
private $next;
public function __construct($this->value, $this->next = null);
} ($value, $next);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment