3v4l.org

run code in 300+ PHP versions simultaneously
<?php $componentId = JComponentHelper::getComponent('com_comonentname')->id; $db = JFactory::getDbo(); $select = $db->getQuery(true) ->select($db->qn('params')) ->from($db->qn('#__extensions')) ->where($db->qn('extension_id') . ' = '. (int)$componentId); $db->setQuery($select); $object = json_decode($db->loadResult()); $object->your_param = "dev.com"; $newJson = json_encode($object); $update = $db->getQuery(true) ->update($db->qn('#__extensions')) ->set($db->qn('params') . " = '" . $db->q($newJson)) ->where($db->qn('extension_id') . ' = ' . (int)$componentId); $db->setQuery($update); $result = $db->execute();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Class "JComponentHelper" not found in /in/YMs3s:2 Stack trace: #0 {main} thrown in /in/YMs3s on line 2
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'JComponentHelper' not found in /in/YMs3s:2 Stack trace: #0 {main} thrown in /in/YMs3s on line 2
Process exited with code 255.

preferences:
222.45 ms | 402 KiB | 211 Q