3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function get_last_dot_occurence ($url ) { $fullArray = explode('.', $url); $newArray; switch (count($fullArray)) { case 1: $newArray = $url; break; case 2: $newArray = array("string1" => $fullArray[0], "string2" => $fullArray[1]); break; default: break; } return $newArray; } get_last_dot_occurence("test.com");
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Output for 5.0.4 - 5.0.5, hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: newArray in /in/DOucY on line 4
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: newArray in /in/DOucY on line 4