3v4l.org

run code in 300+ PHP versions simultaneously
<?php $segments1 = ["foo", "bar", "0", "", FALSE, 0, NULL]; $segments2 = array_filter($segments1, function (string $segment) { return $segment !== ''; }); var_export([$segments1, $segments2]);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($segment) must be of type string, null given in /in/fC7d8:4 Stack trace: #0 [internal function]: {closure}(NULL) #1 /in/fC7d8(4): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/fC7d8 on line 4
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:
51.34 ms | 405 KiB | 5 Q