3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = JFactory::getUser(); $query = $db->getQuery(true) ->select("s.FieldName, SUM(s.FieldValue) AS Sum") ->from("#__rsform_submission_values AS sv") ->innerJoin("#__rsform_submissions AS s ON sv.FormId = s.FormId") ->where([ "s.User_Id = " . (int)$user->id, "sv.FieldName IN (" . implode(',', $db->q($months)) . ")" ]) ->group("sv.FieldName");
Output for 8.0.0 - 8.0.11, 8.1rc1 - rc2
Fatal error: Uncaught Error: Class "JFactory" not found in /in/OHRfV:3 Stack trace: #0 {main} thrown in /in/OHRfV on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.30, 7.4.0 - 7.4.23
Fatal error: Uncaught Error: Class 'JFactory' not found in /in/OHRfV:3 Stack trace: #0 {main} thrown in /in/OHRfV on line 3
Process exited with code 255.

preferences:
78.81 ms | 532 KiB | 14 Q