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 );
Finding entry points
Branch analysis from position: 0
5 jumps found. (Code = 188) Position 1 = 14, Position 2 = 49, Position 3 = 118, Position 4 = 152, Position 5 = 7
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 152
Branch analysis from position: 152
1 jumps found. (Code = 42) Position 1 = 162
Branch analysis from position: 162
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 83
Branch analysis from position: 82
2 jumps found. (Code = 43) Position 1 = 93, Position 2 = 94
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 152
Branch analysis from position: 152
Branch analysis from position: 94
Branch analysis from position: 83
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 152
Branch analysis from position: 152
Branch analysis from position: 152
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 49
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 118
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 152
Branch analysis from position: 152
Branch analysis from position: 118
Branch analysis from position: 49
Branch analysis from position: 14
Found catch point at position: 154
Branch analysis from position: 154
2 jumps found. (Code = 107) Position 1 = 155, Position 2 = -2
Branch analysis from position: 155
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rDvXl
function name:  (null)
number of ops:  178
compiled vars:  !0 = $iAccount, !1 = $sPassword, !2 = $oQiwi, !3 = $iID, !4 = $iRedirectAccount, !5 = $dRedirectAmount, !6 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL_BY_NAME                                       'getField'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_FUNC_ARG               global              $7      '_POST'
          3        SEND_FUNC_ARG                                            $7
          4        SEND_VAL_EX                                              'sMod'
          5        DO_FCALL                                      0  $8      
          6      > SWITCH_STRING                                            $8, [ 'addQiwiAccount':->14, 'saveQiwiAccount':->49, 'deleteQiwiAccount':->118, ], ->152
    9     7    >   CASE                                                     $8, 'addQiwiAccount'
          8      > JMPNZ                                                    ~9, ->14
   30     9    >   CASE                                                     $8, 'saveQiwiAccount'
         10      > JMPNZ                                                    ~9, ->49
   56    11    >   CASE                                                     $8, 'deleteQiwiAccount'
         12      > JMPNZ                                                    ~9, ->118
         13    > > JMP                                                      ->152
   12    14    >   INIT_FCALL_BY_NAME                                       'getField'
         15        CHECK_FUNC_ARG                                           
         16        FETCH_FUNC_ARG               global              $10     '_POST'
         17        SEND_FUNC_ARG                                            $10
         18        SEND_VAL_EX                                              'iAccount'
         19        SEND_VAL_EX                                              'int'
         20        DO_FCALL                                      0  $11     
         21        ASSIGN                                                   !0, $11
   13    22        INIT_FCALL_BY_NAME                                       'getField'
         23        CHECK_FUNC_ARG                                           
         24        FETCH_FUNC_ARG               global              $13     '_POST'
         25        SEND_FUNC_ARG                                            $13
         26        SEND_VAL_EX                                              'sPassword'
         27        DO_FCALL                                      0  $14     
         28        ASSIGN                                                   !1, $14
   16    29        NEW                                              $16     'Qiwi'
         30        SEND_VAR_EX                                              !0
         31        SEND_VAR_EX                                              !1
         32        DO_FCALL                                      0          
         33        ASSIGN                                                   !2, $16
   19    34        INIT_METHOD_CALL                                         !2, 'clearCookie'
         35        DO_FCALL                                      0          
   22    36        INIT_STATIC_METHOD_CALL                                  'Shop', 'dbQiwiAccounts'
         37        DO_FCALL                                      0  $20     
         38        INIT_METHOD_CALL                                         $20, 'create'
         39        INIT_ARRAY                                       ~21     !0, 'iAccount'
         40        ADD_ARRAY_ELEMENT                                ~21     !1, 'sPassword'
         41        SEND_VAL_EX                                              ~21
         42        DO_FCALL                                      0          
   25    43        INIT_FCALL_BY_NAME                                       'jsAlert'
         44        CONCAT                                           ~23     'Qiwi.%D0%BA%D0%BE%D1%88%D0%B5%D0%BB%D0%B5%D0%BA+%2B', !0
         45        CONCAT                                           ~24     ~23, '+%D1%83%D1%81%D0%BF%D0%B5%D1%88%D0%BD%D0%BE+%D0%B4%D0%BE%D0%B1%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%21'
         46        SEND_VAL_EX                                              ~24
         47        DO_FCALL                                      0          
   27    48      > JMP                                                      ->152
   33    49    >   INIT_FCALL_BY_NAME                                       'getField'
         50        CHECK_FUNC_ARG                                           
         51        FETCH_FUNC_ARG               global              $26     '_POST'
         52        SEND_FUNC_ARG                                            $26
         53        SEND_VAL_EX                                              'iID'
         54        SEND_VAL_EX                                              'int'
         55        DO_FCALL                                      0  $27     
         56        ASSIGN                                                   !3, $27
   34    57        INIT_FCALL_BY_NAME                                       'getField'
         58        CHECK_FUNC_ARG                                           
         59        FETCH_FUNC_ARG               global              $29     '_POST'
         60        SEND_FUNC_ARG                                            $29
         61        SEND_VAL_EX                                              'iAccount'
         62        SEND_VAL_EX                                              'int'
         63        DO_FCALL                                      0  $30     
         64        ASSIGN                                                   !0, $30
   35    65        INIT_FCALL_BY_NAME                                       'getField'
         66        CHECK_FUNC_ARG                                           
         67        FETCH_FUNC_ARG               global              $32     '_POST'
         68        SEND_FUNC_ARG                                            $32
         69        SEND_VAL_EX                                              'sPassword'
         70        DO_FCALL                                      0  $33     
         71        ASSIGN                                                   !1, $33
   36    72        INIT_FCALL_BY_NAME                                       'getField'
         73        CHECK_FUNC_ARG                                           
         74        FETCH_FUNC_ARG               global              $35     '_POST'
         75        SEND_FUNC_ARG                                            $35
         76        SEND_VAL_EX                                              'iRedirectAccount'
         77        SEND_VAL_EX                                              'int'
         78        DO_FCALL                                      0  $36     
         79        ASSIGN                                           ~37     !4, $36
         80        IS_SMALLER_OR_EQUAL                                      ~37, 0
         81      > JMPZ                                                     ~38, ->83
   37    82    >   ASSIGN                                                   !4, null
   38    83    >   INIT_FCALL_BY_NAME                                       'getField'
         84        CHECK_FUNC_ARG                                           
         85        FETCH_FUNC_ARG               global              $40     '_POST'
         86        SEND_FUNC_ARG                                            $40
         87        SEND_VAL_EX                                              'dRedirectAmount'
         88        SEND_VAL_EX                                              'money'
         89        DO_FCALL                                      0  $41     
         90        ASSIGN                                           ~42     !5, $41
         91        IS_SMALLER                                               ~42, 0.01
         92      > JMPZ                                                     ~43, ->94
   39    93    >   ASSIGN                                                   !5, null
   42    94    >   NEW                                              $45     'Qiwi'
         95        SEND_VAR_EX                                              !0
         96        SEND_VAR_EX                                              !1
         97        DO_FCALL                                      0          
         98        ASSIGN                                                   !2, $45
   45    99        INIT_METHOD_CALL                                         !2, 'clearCookie'
        100        DO_FCALL                                      0          
   48   101        INIT_STATIC_METHOD_CALL                                  'Shop', 'dbQiwiAccounts'
        102        DO_FCALL                                      0  $49     
        103        INIT_METHOD_CALL                                         $49, 'edit'
        104        INIT_ARRAY                                       ~50     !3, 'iID'
        105        SEND_VAL_EX                                              ~50
        106        INIT_ARRAY                                       ~51     !0, 'iAccount'
        107        ADD_ARRAY_ELEMENT                                ~51     !1, 'sPassword'
        108        ADD_ARRAY_ELEMENT                                ~51     !4, 'iRedirectAccount'
        109        ADD_ARRAY_ELEMENT                                ~51     !5, 'dRedirectAmount'
        110        SEND_VAL_EX                                              ~51
        111        DO_FCALL                                      0          
   51   112        INIT_FCALL_BY_NAME                                       'jsAlert'
        113        CONCAT                                           ~53     '%D0%94%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5+Qiwi.%D0%BA%D0%BE%D1%88%D0%B5%D0%BB%D1%8C%D0%BA%D0%B0+%2B', !0
        114        CONCAT                                           ~54     ~53, '+%D1%83%D1%81%D0%BF%D0%B5%D1%88%D0%BD%D0%BE+%D1%81%D0%BE%D1%85%D1%80%D0%B0%D0%BD%D0%B5%D0%BD%D1%8B%21'
        115        SEND_VAL_EX                                              ~54
        116        DO_FCALL                                      0          
   53   117      > JMP                                                      ->152
   59   118    >   INIT_FCALL_BY_NAME                                       'getField'
        119        CHECK_FUNC_ARG                                           
        120        FETCH_FUNC_ARG               global              $56     '_POST'
        121        SEND_FUNC_ARG                                            $56
        122        SEND_VAL_EX                                              'iID'
        123        SEND_VAL_EX                                              'integer'
        124        DO_FCALL                                      0  $57     
        125        ASSIGN                                                   !3, $57
   60   126        INIT_FCALL_BY_NAME                                       'getField'
        127        CHECK_FUNC_ARG                                           
        128        FETCH_FUNC_ARG               global              $59     '_POST'
        129        SEND_FUNC_ARG                                            $59
        130        SEND_VAL_EX                                              'iAccount'
        131        SEND_VAL_EX                                              'int'
        132        DO_FCALL                                      0  $60     
        133        ASSIGN                                                   !0, $60
   63   134        INIT_STATIC_METHOD_CALL                                  'Shop', 'dbQiwiAccounts'
        135        DO_FCALL                                      0  $62     
        136        INIT_METHOD_CALL                                         $62, 'delete'
        137        INIT_ARRAY                                       ~63     !3, 'iID'
        138        SEND_VAL_EX                                              ~63
        139        DO_FCALL                                      0          
   66   140        INIT_STATIC_METHOD_CALL                                  'Shop', 'dbOrders'
        141        DO_FCALL                                      0  $65     
        142        INIT_METHOD_CALL                                         $65, 'delete'
        143        INIT_ARRAY                                       ~66     !0, 'iQiwiAccount'
        144        SEND_VAL_EX                                              ~66
        145        DO_FCALL                                      0          
   69   146        INIT_FCALL_BY_NAME                                       'jsAlert'
        147        CONCAT                                           ~68     'Qiwi.%D0%BA%D0%BE%D1%88%D0%B5%D0%BB%D0%B5%D0%BA+%2B', !0
        148        CONCAT                                           ~69     ~68, '+%D1%83%D1%81%D0%BF%D0%B5%D1%88%D0%BD%D0%BE+%D1%83%D0%B4%D0%B0%D0%BB%D0%B5%D0%BD%21'
        149        SEND_VAL_EX                                              ~69
        150        DO_FCALL                                      0          
   71   151      > JMP                                                      ->152
        152    >   FREE                                                     $8
        153      > JMP                                                      ->162
   74   154  E > > CATCH                                       last         'Exception'
   77   155    >   INIT_FCALL_BY_NAME                                       'jsAlert'
        156        INIT_METHOD_CALL                                         !6, 'getMessage'
        157        DO_FCALL                                      0  $71     
        158        CONCAT                                           ~72     '%D0%9E%D1%88%D0%B8%D0%B1%D0%BA%D0%B0%3A+', $71
        159        CONCAT                                           ~73     ~72, '%21'
        160        SEND_VAL_EX                                              ~73
        161        DO_FCALL                                      0          
   81   162    >   INIT_FCALL_BY_NAME                                       'Smarty'
        163        DO_FCALL                                      0  $75     
        164        INIT_METHOD_CALL                                         $75, 'assign'
        165        SEND_VAL_EX                                              'aQiwiAccounts'
        166        INIT_STATIC_METHOD_CALL                                  'Shop', 'dbQiwiAccounts'
        167        DO_FCALL                                      0  $76     
        168        INIT_METHOD_CALL                                         $76, 'searchAll'
        169        SEND_VAL_EX                                              ''
        170        SEND_VAL_EX                                              'm.%2A'
        171        SEND_VAL_EX                                              'iTurnover'
        172        SEND_VAL_EX                                              'asc'
        173        DO_FCALL                                      0  $77     
        174        SEND_VAR_NO_REF_EX                                       $77
        175        SEND_VAL_EX                                              <true>
        176        DO_FCALL                                      0          
        177      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.05 ms | 1411 KiB | 13 Q