3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Account_ActionsController extends Custom_Controller_AccountAction { /** @var $_user2classifierObj Account_Model_User2Classifier_Object*/ protected $_user2classifierObj; /** @var $_user2classifierMap Account_Model_User2Classifier_Mapper*/ protected $_user2classifierMap; public function init() { parent::init(); $this->_user2classifierObj = new Account_Model_User2Classifier_Object(); $this->_user2classifierMap = new Account_Model_User2Classifier_Mapper(); } public function indexAction() { // action body } public function aEditEClassifierAction() { $form = new Account_Form_Actions_Admin_EditExecutorClassifier(); if($_POST && isset($_POST['edit-executor-classifier'])) { $this->view->form =$form->populate($_POST); } if($_POST && isset($_POST['save'])) { // Zend_Debug::dump($_POST);die; if(isset($_POST['id_user'])) { if(isset($_POST['classifier'])) { $classifierArray = $_POST['classifier']; $result = array(); if(is_array($classifierArray)) { foreach ($classifierArray as $nl1=>$val1) { $result[]=$nl1; if(is_array($val1)) { foreach ($val1 as $nl2=>$val2) { if( is_array($val2)) { $result[]=$nl2; foreach ($val2 as $nl3=>$val3) { $result[]=$nl3; } } else { $result[]=$nl2; } } } } } } else { $result = null; } $this->_custom_response = $this->_user2classifierObj ->setIdUser($_POST['id_user']) ->_save($result); $this->_helper->getHelper("FlashMessenger")->addMessage($this->_custom_response->getMessage()); $this->_helper->redirector('a-executor','list','account'); } } } public function eEditEClassifierAction() { $form = new Account_Form_Actions_Admin_EditExecutorClassifier(); $form->id_user->setValue(Custom_Helper_CurrentUser::currentUser()->getIdUser()); $this->view->form = $form; if($_POST && isset($_POST['save'])) { if(isset($_POST['id_user'])) { if(isset($_POST['classifier'])) { $classifierArray = $_POST['classifier']; $result = array(); if(is_array($classifierArray)) { foreach ($classifierArray as $nl1=>$val1) { $result[]=$nl1; if(is_array($val1)) { foreach ($val1 as $nl2=>$val2) { if( is_array($val2)) { $result[]=$nl2; foreach ($val2 as $nl3=>$val3) { $result[]=$nl3; } } else { $result[]=$nl2; } } } } } } else { $result = null; } $this->_custom_response = $this->_user2classifierObj ->setIdUser($_POST['id_user']) ->_save($result); $this->_helper->getHelper("FlashMessenger")->addMessage($this->_custom_response->getMessage()); $this->_helper->redirector('index','profile','account'); } } } public function aEditCAction() { $this->_nextUrl = BASE_DOMAIN.'account/list/a-client'; $this->_backUrl = BASE_DOMAIN.'account/list/a-client'; $this->_editUser('Account_Form_Actions_Admin_Edit_Client'); } public function aEditMAction() { $this->_nextUrl = BASE_DOMAIN.'account/list/a-manager'; $this->_backUrl = BASE_DOMAIN.'account/list/a-manager'; $this->_editUser('Account_Form_Actions_Admin_Edit_Manager'); } public function aEditEAction() { $this->_nextUrl = BASE_DOMAIN.'account/list/a-executor'; $this->_backUrl = BASE_DOMAIN.'account/list/a-executor'; $this->_editUser('Account_Form_Actions_Admin_Edit_Executor'); } public function aAddUserAction() { $this->_backUrl = BASE_DOMAIN.'account/list/a-client'; $this->_nextUrl = BASE_DOMAIN.'account/actions/a-add-user'; $form = new Account_Form_Actions_Admin_Add_User(); $this->view->form = $form; if($_POST && isset($_POST['save'])) { if($form->isValid($_POST)) { $this->_userObj = $this->_prepareUserDataToObject($_POST); $password = $this->_helperAuth->generatePassword(); $this->_custom_response = $this->_userObj ->setPassword($password) ->setLogin($this->_userObj->getEmail()) ->_save(); ; if($this->_checkCustomResponse()) { $this->_mail ->addTo($this->_userObj->getEmail()) ->setSubject(Custom_Mail_Texts::$_registration_subject) ->setBodyHtml(Custom_Mail_Texts::registration( $this->_userObj->getBlankUser( array( 'password'=>$password, 'login'=>$this->_userObj->getLogin() ) ) ) ) ->send() ; $this->_custom_response->addMessage( 'На электронный адрес <b>'.$this->_userObj->getEmail().'</b> было отправлено письмо с данными вашей учетной записи.','<br/>'); $this->_helper->getHelper("FlashMessenger")->addMessage($this->_custom_response->getMessage()); $this->_helper->redirector->gotoUrl($this->_nextUrl); } } else { $this->view->form = $form->populate($_POST); } } elseif($_POST && isset($_POST['back'])) { $this->_helper->redirector->gotoUrl($this->_backUrl); } }
Output for 5.4.0 - 5.4.36
Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) in /in/4C5dQ on line 228
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected $end, expecting T_FUNCTION in /in/4C5dQ on line 228
Process exited with code 255.