3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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])); foreach($player as $playerval){ list($player1, $player2, $player3, $player4, $player5, $player6) = each($player); } $endplayer = end($player); $sisaplayer = $pp[2]; $ppkartu = preg_match("#^([a-z0-9\-\._:]+) ?(\((.*)\))?$#i", $str1, $pk); $pkartu = $pk[2]; $pbdraw = preg_match('#^Bot draws - '.$pk[2].': ?(\((.*)\))?$#i', $str2, $pb); $pbplayer = $pb; $pbkartu = $pb[2]; print_r($playerval);
Output for 7.0.0 - 7.1.0
Notice: Undefined offset: 2 in /in/P60QC on line 8 Notice: Undefined offset: 3 in /in/P60QC on line 8 Notice: Undefined offset: 4 in /in/P60QC on line 8 Notice: Undefined offset: 5 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 8 Notice: Undefined offset: 3 in /in/P60QC on line 8 Notice: Undefined offset: 4 in /in/P60QC on line 8 Notice: Undefined offset: 5 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 8 Notice: Undefined offset: 3 in /in/P60QC on line 8 Notice: Undefined offset: 4 in /in/P60QC on line 8 Notice: Undefined offset: 5 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 8 Notice: Undefined offset: 3 in /in/P60QC on line 8 Notice: Undefined offset: 4 in /in/P60QC on line 8 Notice: Undefined offset: 5 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 16 nono
Output for 5.5.0 - 5.6.28
Notice: Undefined offset: 5 in /in/P60QC on line 8 Notice: Undefined offset: 4 in /in/P60QC on line 8 Notice: Undefined offset: 3 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 8 Notice: Undefined offset: 5 in /in/P60QC on line 8 Notice: Undefined offset: 4 in /in/P60QC on line 8 Notice: Undefined offset: 3 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 8 Notice: Undefined offset: 5 in /in/P60QC on line 8 Notice: Undefined offset: 4 in /in/P60QC on line 8 Notice: Undefined offset: 3 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 8 Notice: Undefined offset: 2 in /in/P60QC on line 16 nono
Output for 4.3.0 - 5.4.45
nono