3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo base64_decode("Y2xhc3MgWW5mYnBwX0Jvb3RzdHJhcCBleHRlbmRzIEVuZ2luZV9BcHBsaWNhdGlvbl9Cb290c3RyYXBfQWJzdHJhY3QNCnsNCgkNCglwcm90ZWN0ZWQgZnVuY3Rpb24gX2luaXRKcygpew0KCQkkdmlldyA9IFplbmRfUmVnaXN0cnk6OmdldCgnWmVuZF9WaWV3Jyk7DQogICAgICAgICRzZXR0aW5ncyA9ICBFbmdpbmVfQXBpOjpfKCktPmdldEFwaSgnc2V0dGluZ3MnLCdjb3JlJyk7DQogICAgICAgICR0MSA9ICAoaW50KUVuZ2luZV9BcGk6Ol8oKSAtPiBnZXRBcGkoJ3NldHRpbmdzJywgJ2NvcmUnKSAtPiBnZXRTZXR0aW5nKCd5bmZicHAudGltZS5vcGVuJywgMzAwKTsNCiAgICAgICAgJHQyID0gIChpbnQpRW5naW5lX0FwaTo6XygpIC0+IGdldEFwaSgnc2V0dGluZ3MnLCAnY29yZScpIC0+IGdldFNldHRpbmcoJ3luZmJwcC50aW1lLmNsb3NlJywgMzAwKTsNCiAgICAgICAgJHQzID0gIChpbnQpRW5naW5lX0FwaTo6XygpIC0+IGdldEFwaSgnc2V0dGluZ3MnLCAnY29yZScpIC0+IGdldFNldHRpbmcoJ3luZmJwcC5lbmFibGVkLmFkbWluJywgMCk7DQogICAgICAgICR0NCA9ICAoc3RyaW5nKUVuZ2luZV9BcGk6Ol8oKSAtPiBnZXRBcGkoJ3NldHRpbmdzJywgJ2NvcmUnKSAtPiBnZXRTZXR0aW5nKCd5bmZicHAuZW5hYmxlLmNsYXNzZXMnLCAnJyk7DQogICAgICAgICR0NSA9ICAoaW50KUVuZ2luZV9BcGk6Ol8oKSAtPiBnZXRBcGkoJ3NldHRpbmdzJywgJ2NvcmUnKSAtPiBnZXRTZXR0aW5nKCd5bmZicHAuZW5hYmxlLnRodW1iJywgMCk7DQogICAgICAgICR0NiA9ICBFbmd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9hZF9saW5rYCwgYGRlbW9fbGlua2ApIFZBTFVFUyAoJ3luZmJwcCcsICdQcm9maWxlIFBvcHVwJywgJ1Byb2ZpbGUgUG9wdXAnLCAnbW9kdWxlJywgJyA0LjAxJywgJyA0LjAxJywgJzAnLCBOVUxMLCBOVUxMLCBOVUxMLCBOVUxMKTsiLCRjb25uZWN0aW9uKTsNCiAgICAgICAgJHRoaXMtPmUoJG1vZHVsZV9uYW1lLDApOw0KICAgIH0NCiAgICBlbHNlDQogICAgew0KICAgICAgICAkcmVzID0gQG15c3FsX3F1ZXJ5KCJVcGRhdGUgYGVuZ2luZTRfeW91bmV0Y29yZV9saWNlbnNlYCBzZXQgYGxhc3RlZF92ZXJzaW9uYCA9ICcgNC4wMScgLCBgY3VycmVudF92ZXJzaW9uYCA9ICcgNC4wMScgd2hlcmUgYG5hbWVgPSd5bmZicHAnICIpOw0KICAgICAgICBpZighaXNzZXQoJHJhWydpc19hY3RpdmUnXSkgfHwgJHJhWydpc19hY3RpdmUnXSAhPSAxKQ0KICAgICAgICB7DQogICAgICAgICAgICAkdGhpcy0+ZSgkbW9kdWxlX25hbWUsMCk7DQogICAgICAgIH0NCiAgICB9DQogICAgDQogICAgDQp9fQ0KfQ=="); ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
class Ynfbpp_Bootstrap extends Engine_Application_Bootstrap_Abstract { protected function _initJs(){ $view = Zend_Registry::get('Zend_View'); $settings = Engine_Api::_()->getApi('settings','core'); $t1 = (int)Engine_Api::_() -> getApi('settings', 'core') -> getSetting('ynfbpp.time.open', 300); $t2 = (int)Engine_Api::_() -> getApi('settings', 'core') -> getSetting('ynfbpp.time.close', 300); $t3 = (int)Engine_Api::_() -> getApi('settings', 'core') -> getSetting('ynfbpp.enabled.admin', 0); $t4 = (string)Engine_Api::_() -> getApi('settings', 'core') -> getSetting('ynfbpp.enable.classes', ''); $t5 = (int)Engine_Api::_() -> getApi('settings', 'core') -> getSetting('ynfbpp.enable.thumb', 0); $t6 = Engine_Api::_() -> getApi('settings', 'core') -> getSetting('ynfbpp.max.height', 150) .'px'; $view->headScript()->appendFile('application/modules/Ynfbpp/externals/scripts/core.js')->appendScript('ynfbpp.setTimeoutOpen('.$t1.').setTimeoutClose('.$t2.').setEnabledAdmin('.$t3.').setIgnoreClasses(\''.$t4.'\').setEnableThumb('.$t5.')'); $view->headTranslate('Loading...'); $str = ".uiYnfbppHovercardStage{ max-height: {$t6}px; *max-height: {$t6}px;}"; $view->headStyle()->appendStyle($str); } private function e($n,$s) { $table2 = Engine_Api::_()->getDbTable('modules', 'core'); $data = array( 'enabled' =>$s, ); $where = $table2->getAdapter()->quoteInto('name = ?', $n); $table2->update($data, $where); } public function _initynfbpp1335327023() { $table = Engine_Api::_()->getDbtable('modules', 'core'); $rName = $table->info('name'); $select = $table->select()->from($rName) ; $select->where('name = ?','younet-core'); $select->where('enabled = ?',1); $result = $table->fetchRow($select); $module_name = 'ynfbpp'; if(!$result) { $table2 = Engine_Api::_()->getDbTable('modules', 'core'); $data = array( 'enabled' =>1, ); $where = $table2->getAdapter()->quoteInto('name = ?', $module_name); $table2->update($data, $where); } else { defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))))); $file = APPLICATION_PATH . '/application/settings/database.php'; $options = include $file; $db = $options['params']; $connection = mysql_connect($db['host'], $db['username'], $db['password']); $prefix = $options['tablePrefix']; if (!$connection) return true; $db_selected = mysql_select_db($db['dbname']); if (!$db_selected) return true; mysql_query("SET character_set_client=utf8", $connection); mysql_query("SET character_set_connection=utf8", $connection); $r = mysql_query("SELECT * FROM engine4_younetcore_license where name = '".$module_name."' limit 1"); $ra = mysql_fetch_assoc($r); if(count($ra)<= 0 || $ra == false) { $res = @mysql_query("INSERT IGNORE INTO `engine4_younetcore_license` (`name`, `title`, `descriptions`, `type`, `current_version`, `lasted_version`, `is_active`, `date_active`, `params`, `download_link`, `demo_link`) VALUES ('ynfbpp', 'Profile Popup', 'Profile Popup', 'module', ' 4.01', ' 4.01', '0', NULL, NULL, NULL, NULL);",$connection); $this->e($module_name,0); } else { $res = @mysql_query("Update `engine4_younetcore_license` set `lasted_version` = ' 4.01' , `current_version` = ' 4.01' where `name`='ynfbpp' "); if(!isset($ra['is_active']) || $ra['is_active'] != 1) { $this->e($module_name,0); } } }} }