3v4l.org

run code in 300+ PHP versions simultaneously
<?php public function getGroupId($groupName) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('id, title') ->from("#__usergroups") ->where("title = " . $db->q($groupName)); $db->setQuery($query); $result = $db->loadResult(); return $result ? $result : false; }
Output for 7.1.25 - 7.1.33, 7.2.0 - 7.2.24, 7.3.0 - 7.3.11
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /in/e3gTP on line 3
Process exited with code 255.

preferences:
187.71 ms | 1387 KiB | 53 Q