3v4l.org

run code in 300+ PHP versions simultaneously
<?php # Ловим исключения : try { # Обработка POST - запросов : switch( getField( $_POST, 'sMod' ) ) { # Добавление Qiwi.кошелька : case 'addQiwiAccount': # Получение внешних данных : $iAccount = getField( $_POST, 'iAccount', 'int' ); $sPassword = getField( $_POST, 'sPassword' ); # Подключение к кошельку : $oQiwi = new Qiwi( $iAccount, $sPassword ); # Очистка файла cookie : $oQiwi->clearCookie(); # Добавление данных в базу : Shop::dbQiwiAccounts()->create( array( 'iAccount' => $iAccount, 'sPassword' => $sPassword ) ); # Debug : jsAlert( 'Qiwi.кошелек +'.$iAccount.' успешно добавлен!' ); break; # Сохранение Qiwi.кошелька : case 'saveQiwiAccount': # Получение внешних данных : $iID = getField( $_POST, 'iID', 'int' ); $iAccount = getField( $_POST, 'iAccount', 'int' ); $sPassword = getField( $_POST, 'sPassword' ); if( ($iRedirectAccount = getField( $_POST, 'iRedirectAccount', 'int' )) <= 0 ) $iRedirectAccount = null; if( ($dRedirectAmount = getField( $_POST, 'dRedirectAmount', 'money' )) < 0.01 ) $dRedirectAmount = null; # Подключение к кошельку : $oQiwi = new Qiwi( $iAccount, $sPassword ); # Очистка файла cookie : $oQiwi->clearCookie(); # Сохранение данных в базе : Shop::dbQiwiAccounts()->edit( array( 'iID' => $iID ), array( 'iAccount' => $iAccount, 'sPassword' => $sPassword, 'iRedirectAccount' => $iRedirectAccount, 'dRedirectAmount' => $dRedirectAmount ) ); # Debug : jsAlert( 'Данные Qiwi.кошелька +'.$iAccount.' успешно сохранены!' ); break; # Удаление Qiwi.кошелька : case 'deleteQiwiAccount': # Получение внешних данных : $iID = getField( $_POST, 'iID', 'integer' ); $iAccount = getField( $_POST, 'iAccount', 'int' ); # Удаление данных из базы : Shop::dbQiwiAccounts()->delete( array( 'iID' => $iID ) ); # Удаление заказов с этим кошельком : Shop::dbOrders()->delete( array( 'iQiwiAccount' => $iAccount ) ); # Debug : jsAlert( 'Qiwi.кошелек +'.$iAccount.' успешно удален!' ); break; } } catch( Exception $e ) { # Debug : jsAlert( 'Ошибка: '.$e->getMessage().'!' ); } # Подключаем список кошельков к шаблону : Smarty()->assign( 'aQiwiAccounts', Shop::dbQiwiAccounts()->searchAll( '', 'm.*', 'iTurnover', 'asc' ), true );
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function getField() in /in/rDvXl:6 Stack trace: #0 {main} thrown in /in/rDvXl on line 6
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
72.86 ms | 401 KiB | 8 Q