Skip to content

Instantly share code, notes, and snippets.

@NinoSkopac
Created May 13, 2018 02:57
Show Gist options
  • Save NinoSkopac/de2def15f33b3df4db1dabe15a5eed1b to your computer and use it in GitHub Desktop.
Save NinoSkopac/de2def15f33b3df4db1dabe15a5eed1b to your computer and use it in GitHub Desktop.
some weird ass PHP code
<?php
new class {
private $foo;
private $bar;
public function __construct()
{
$this->bar = function(int $id, array $elems) {
print $id;
};
$this->foo = function(...$args) {
($this->bar)(...$args);
};
($this->foo)(123, ['elem']);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment