3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Carolina -6,5 - Indianapolis '; if (mb_ereg('^(.+)[[:space:]]+(([-]?[0-9]+[,.]?[0-9]*) /)?([-]?[0-9]+[,.]?[0-9]*)? -(.+)$', $text, $ar)) $team = 1; var_dump($ar, $team); if (mb_ereg('^(.+) - (.+)[[:space:]]+(([-]?[0-9]+[,.]?[0-9]*) /)?([-]?[0-9]+[,.]?[0-9]*)?$', $text, $ar)) $team = 2; var_dump($ar, $team); foreach ($ar as $key => &$a) $a = str_replace(array(",", "+"), array(".", ""), $a); var_dump($ar); $home = 23; $away = 23; if ($team == 1) $home = $home + $ar[4]; elseif ($team == 2) $away = $away + $ar[5]; var_dump($home, $away);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> string(29) "Carolina -6,5 - Indianapolis " [1]=> string(8) "Carolina" [2]=> bool(false) [3]=> bool(false) [4]=> string(4) "-6,5" [5]=> string(14) " Indianapolis " } int(1) array(6) { [0]=> string(29) "Carolina -6,5 - Indianapolis " [1]=> string(13) "Carolina -6,5" [2]=> string(12) "Indianapolis" [3]=> bool(false) [4]=> bool(false) [5]=> bool(false) } int(2) array(6) { [0]=> string(29) "Carolina -6.5 - Indianapolis " [1]=> string(13) "Carolina -6.5" [2]=> string(12) "Indianapolis" [3]=> string(0) "" [4]=> string(0) "" [5]=> &string(0) "" } Fatal error: Uncaught TypeError: Unsupported operand types: int + string in /in/rEUgQ:20 Stack trace: #0 {main} thrown in /in/rEUgQ on line 20
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:
52.38 ms | 402 KiB | 8 Q