3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Customizable resource for setting view options. * * Additional configuration options: * * resources.view.class = "Zend_View" * resources.view.scriptPathSpec = * resources.view.scriptPathNoControllerSpec = * resources.view.suffix = * resources.view.noRender = * resources.view.translator = * resources.view.headTitle.title = * resources.view.headTitle.separator = * resources.view.headTitle.defaultAttachOrder = * * Options providing Zend_Application_Resource_View functionality: * * resources.view.doctype = * resources.view.charset = * resources.view.contentType = * * Options handled by the Zend_View_Abstract constructor: * * resources.view.escape = * resources.view.encoding = * resources.view.basePath = * resources.view.basePathPrefix = * resources.view.scriptPath = * resources.view.helperPath = * resources.view.filterPath = * resources.view.filter = * resources.view.strictVars = * resources.view.lfiProtectionOn = * resources.view.assign = * * * @version 2014-06-23 / 2013-12-05 * @author xemlock */ class Zefram_Application_Resource_View extends Zend_Application_Resource_ResourceAbstract { /** * @var string */ protected $_viewClass = 'Zend_View'; /** * @var Zend_View_Abstract */ protected $_view; /** * @param array $options */ public function __construct(array $options = null) { if (isset($options['class'])) { $this->_class = $options['class']; unset($options['class']); } $options = array_change_key_case($options, CASE_LOWER); parent::__construct($options); } /** * @return Zend_View_Abstract */ public function init() { $options = $this->getOptions(); $view = new {$this->_viewClass}($options); $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer'); $viewRenderer->setView($view); // Set view script path specification if (isset($options['scriptpathspec'])) { $viewRenderer->setViewScriptPathSpec($options['scriptpathspec']); } // Set view script path specification (no controller variant) if (isset($options['scriptpathnocontrollerspec'])) { $viewRenderer->setViewScriptPathNoControllerSpec($options['scriptpathnocontrollerspec']); } // Set view script suffix if (isset($options['suffix'])) { $viewRenderer->setViewSuffix($options['suffix']); } // Set the auto-render flag if (isset($options['norender'])) { $viewRenderer->setNoRender($options['norender']); } // Set doctype using doctype view helper if (isset($options['doctype'])) { $view->doctype()->setDoctype(strtoupper($options['doctype'])); } // Create an HTML5-style meta charset tag using headMeta view helper if (isset($options['charset'])) { if (!$view->doctype()->isHtml5()) { throw new Zend_View_Exception('Meta charset tag requires an HTML5 doctype'); } $view->headMeta()->setCharset($options['charset']); } // Set content-type meta tag using headMeta view helper if (isset($options['contenttype'])) { $view->headMeta()->appendHttpEquiv('Content-Type', $options['contenttype']); } // Add http-equiv meta tags using headMeta view helper if (isset($options['httpequiv'])) { foreach ((array) $httpEquiv as $key => $value) { $view->headMeta()->appendHttpEquiv($key, $value); } } // Set head title if (isset($options['headtitle'])) { foreach ($options['headtitle'] as $key => $value) { switch (strtolower($key)) { case 'title': $view->headTitle()->set($value); break; case 'separator': $view->headTitle()->setSeparator($value); break; case 'defaultattachorder': $view->headTitle()->setDefaultAttachOrder($value); break; } } } // Set a translation adapter for translate view helper if (isset($options['translator'])) { $translate = $options['translator']; if (is_string($translate)) { $bootstrap = $this->getBootstrap(); if ($bootstrap->hasResource($translate) || $bootstrap->hasPluginResource($translate)) { $bootstrap->bootstrap($translate); $translate = $bootstrap->getResource($translate); } else { $translate = null; } } if ($translate) { $view->translate()->setTranslator($translate); } } return $view; } /** * Return initialized view object. * * @return Zend_View_Abstract|null */ public function getView() { return $this->_view; } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.290.0130.05412.52
5.4.280.0120.03812.41
5.4.270.0060.04112.41
5.4.260.0100.04312.41
5.4.250.0070.04212.41
5.4.240.0060.03912.41
5.4.230.0090.04712.41
5.4.220.0070.03912.41
5.4.210.0060.04012.41
5.4.200.0080.05312.41
5.4.190.0050.04712.40
5.4.180.0080.03512.40
5.4.170.0040.03812.41
5.4.160.0070.03612.41
5.4.150.0030.04012.40
5.4.140.0120.04912.09
5.4.130.0070.04712.07
5.4.120.0090.05212.04
5.4.110.0090.05612.03
5.4.100.0080.05112.04
5.4.90.0060.03712.03
5.4.80.0060.04012.03
5.4.70.0080.04812.03
5.4.60.0060.03412.03
5.4.50.0050.03712.03
5.4.40.0050.03712.02
5.4.30.0070.03612.02
5.4.20.0100.05412.02
5.4.10.0050.05412.02
5.4.00.0070.05311.51
5.3.280.0070.05012.71
5.3.270.0070.04512.72
5.3.260.0080.04412.72
5.3.250.0020.04312.72
5.3.240.0080.05412.72
5.3.230.0080.04512.71
5.3.220.0050.04012.68
5.3.210.0100.04312.68
5.3.200.0100.03612.68
5.3.190.0060.03912.68
5.3.180.0060.03912.67
5.3.170.0080.03712.67
5.3.160.0090.04912.67
5.3.150.0070.03812.67
5.3.140.0050.03912.66
5.3.130.0050.04212.66
5.3.120.0060.03912.66
5.3.110.0070.03712.66
5.3.100.0080.03512.13
5.3.90.0090.03512.11
5.3.80.0060.04212.10
5.3.70.0070.03612.10
5.3.60.0070.03712.09
5.3.50.0050.03812.03
5.3.40.0070.03612.03
5.3.30.0090.03811.99
5.3.20.0110.04511.77
5.3.10.0070.04511.74
5.3.00.0080.03611.73

preferences:
132.41 ms | 1398 KiB | 7 Q