3v4l.org

run code in 300+ PHP versions simultaneously
<?php $possible0 = explode(',', 'hello, world', -100); $possible1 = explode(',', 'hello, world', -1); $possible2 = explode(',', 'hello, world', 0); $possible3 = explode(',', 'hello, world', 1); $possible4 = explode(',', 'hello, world', 2); $possible5 = explode(',', 'hello, world', 3); $possible6 = explode(',', 'hello, world', 4); try { $impossible1 = explode('', '', -1); } catch (Throwable $impossible1) {} $traced = [$possible0, $possible1, $possible2, $possible3, $possible4, $possible5, $possible6, $impossible1]; /** @psalm-trace $traced */ var_dump($traced); return $traced;
Output for git.master, git.master_jit, rfc.property-hooks
array(8) { [0]=> array(0) { } [1]=> array(1) { [0]=> string(5) "hello" } [2]=> array(1) { [0]=> string(12) "hello, world" } [3]=> array(1) { [0]=> string(12) "hello, world" } [4]=> array(2) { [0]=> string(5) "hello" [1]=> string(6) " world" } [5]=> array(2) { [0]=> string(5) "hello" [1]=> string(6) " world" } [6]=> array(2) { [0]=> string(5) "hello" [1]=> string(6) " world" } [7]=> object(ValueError)#1 (7) { ["message":protected]=> string(51) "explode(): Argument #1 ($separator) cannot be empty" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/0NKlW" ["line":protected]=> int(11) ["trace":"Error":private]=> array(1) { [0]=> array(4) { ["file"]=> string(9) "/in/0NKlW" ["line"]=> int(11) ["function"]=> string(7) "explode" ["args"]=> array(3) { [0]=> string(0) "" [1]=> string(0) "" [2]=> int(-1) } } } ["previous":"Error":private]=> NULL } }

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:
59.28 ms | 403 KiB | 8 Q