3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FakeStringIntTuple { private $data = []; public function returnsCallable() { return $this; } public function __invoke(string $a, int $b) { $this->data[] = [$a, $b]; return $this; } } $tuple = (new FakeStringIntTuple())('foo', 123); var_dump($tuple); $tuple = new FakeStringIntTuple(); $tuple->returnsCallable()('bar', 456); var_dump($tuple); $tuple = (new FakeStringIntTuple()) ('foo', 123) ('bar', 456) ('baz', 789); var_dump($tuple);
based on 4N9if