3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Initialise variables. $lists = []; // Get the message queue $messages = (array)\JFactory::getApplication()->getMessageQueue(); // Build the sorted message list foreach ($messages as $msg) { if (isset($msg['type'], $msg['message'])) { $lists[$msg['type']][] = $msg['message']; } }
based on IvgBT
Output for 8.0.0 - 8.0.3
Fatal error: Uncaught Error: Class "JFactory" not found in /in/DZGWd:5 Stack trace: #0 {main} thrown in /in/DZGWd on line 5
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.28, 7.4.0 - 7.4.16
Fatal error: Uncaught Error: Class 'JFactory' not found in /in/DZGWd:5 Stack trace: #0 {main} thrown in /in/DZGWd on line 5
Process exited with code 255.