3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getIcalRecurrence() { $fooBar = 'd'; switch ($fooBar) { case 'd': $icalRecurrence .= 'DAILY;'; break; case 'w': $icalRecurrence .= 'WEEKLY;'; break; case 'm': $icalRecurrence .= 'MONTHLY;'; break; case 'y': $icalRecurrence .= 'YEARLY;'; break; default: throw new InvalidArgumentException('blackjack && hookers'); break; } return $icalRecurrence; } var_dump(getIcalRecurrence());
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Warning: Undefined variable $icalRecurrence in /in/gbuqF on line 10 string(6) "DAILY;"
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: icalRecurrence in /in/gbuqF on line 10 string(6) "DAILY;"
Output for 7.3.32 - 7.3.33
string(6) "DAILY;"

preferences:
83.23 ms | 401 KiB | 183 Q