-
-
Save nikic/b8fa227ae2f7df2ec916 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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