3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { } class Processor { public function import() { $this->process(function ($data) { return $this->update($data); }); } public function process(Callback $callback) { $data = range(1, 10); foreach ($data as $d) { $callback($d); } } public function update(array $data) { var_dump($data); } } $processor = new Processor(); $processor->import();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Processor::process(): Argument #1 ($callback) must be of type Callback, Closure given, called in /in/VnTLW on line 13 and defined in /in/VnTLW:19 Stack trace: #0 /in/VnTLW(13): Processor->process(Object(Closure)) #1 /in/VnTLW(34): Processor->import() #2 {main} thrown in /in/VnTLW on line 19
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
70.02 ms | 401 KiB | 8 Q