3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'Carolina -6,5 - Indianapolis '; var_dump($text); $text = trim(text); var_dump($text); 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
string(29) "Carolina -6,5 - Indianapolis " Fatal error: Uncaught Error: Undefined constant "text" in /in/XYpXB:4 Stack trace: #0 {main} thrown in /in/XYpXB on line 4
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:
53.34 ms | 401 KiB | 8 Q