3v4l.org

run code in 200+ PHP versions simultaneously
<?php // this will fail type-checking /** @psalm-var list<int> $b */ $b = array_filter([1, 2, 3], function (int $v) { return $v !== 2; }); echo json_encode($b);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
{"0":1,"2":3}
Output for branch php-master+opcache
{"0":1,"2":3}
Output for branch php-master+jit
{"0":1,"2":3}
Output for Typed properties v2
{"0":1,"2":3}
Output for Arrow functions
{"0":1,"2":3}
Output for Object typehint
{"0":1,"2":3}
Output for Array change keys
{"0":1,"2":3}
Output for Lexical anon
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of int, integer given in /in/oUoK2 on line 5
Process exited with code 255.

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