3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'Players are (4): nana, nini, nunu, nono'; $str1 = 'nunu: (JH)'; $str2 = 'Bot draws - nana: (JH) Bot draws - nini: (JH) Bot draws - nunu: (JH) Bot draws - nono: (JH)'; $pplayer = preg_match("#^Players are ?(\((.*)\):)? (.*)$#i", $str, $pp); $player = array_map('trim', explode(',', $pp[3])); $endplayer = end($player); $sisaplayer = $pp[2]; $ppkartu = preg_match("#^([a-z0-9\-\._:]+) ?(\((.*)\))?$#i", $str1, $pk); $pkartu = $pk[2]; $pbdraw = preg_match('#^Bot draws - ([a-z0-9\-\._]+)\: ?(\((.*)\))?$#i', $str2, $pb); $pbplayer = $pb; $pbkartu = $pb[2]; print_r(array_chunk($pbkartu, 2, true));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_chunk(): Argument #1 ($array) must be of type array, string given in /in/1gutA:14 Stack trace: #0 /in/1gutA(14): array_chunk('(JH) Bot draws ...', 2, true) #1 {main} thrown in /in/1gutA 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.09 ms | 401 KiB | 8 Q