3v4l.org

run code in 300+ PHP versions simultaneously
<?php $one = [ ['id'=>182, 'data'=>'foo'], ['id'=>300, 'data'=>'bar'], ['id'=>8, 'data'=>'baz'], ['id'=>52, 'data'=>'bee'] ]; $two = [52, 300]; $result = array_uintersect($one, $two, function($x, $y) { var_dump($x, $y); return $x['id']-$y; }); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["id"]=> int(182) ["data"]=> string(3) "foo" } array(2) { ["id"]=> int(300) ["data"]=> string(3) "bar" } Fatal error: Uncaught TypeError: Unsupported operand types: int - array in /in/6QNvd:14 Stack trace: #0 [internal function]: {closure}(Array, Array) #1 /in/6QNvd(11): array_uintersect(Array, Array, Object(Closure)) #2 {main} thrown in /in/6QNvd on line 14
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:
40.45 ms | 401 KiB | 8 Q