3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function my_array_walk(array $array, callable $cb ) { foreach ($array as $element) { $cb($element); } } my_array_walk(array('12'), function (int $element) {});
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: {closure}(): Argument #1 ($element) must be of type int, string given, called in /in/0Nc7d on line 7 and defined in /in/0Nc7d:11 Stack trace: #0 /in/0Nc7d(7): {closure}('12') #1 /in/0Nc7d(11): my_array_walk(Array, Object(Closure)) #2 {main} thrown in /in/0Nc7d on line 11
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:
126.13 ms | 406 KiB | 5 Q