3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _ts_restrictions_translate_ws_message($message = '') { $source = array( 'The maximum quantity allowed for (\w+) title groups is (\d+) per two-year cycle.', 'The maximum allotment of licenses for this (\w+) title group is (\d+) per two-year cycle.', 'The maximum quantity allowed for (\w+) server products is (\d+) per two-year cycle.', 'Your organization has already requested Get Genuine Full Windows operating system products. This is a one-time-only donation.', 'Get Genuine Windows full operating system requests are subject to a unique approval process, so you cannot combine them with any other products in a single cart. Please remove these products from your cart and complete the check-out process for the remaining products. Then place a second request for the Get Genuine Windows full operating systems.', 'You cannot combine products from the main Microsoft Donations Program with products from the Microsoft Direct Donations Program in a single cart.', 'You must order a minimum of (\d+) seats for (\w+) product orders.', 'You can order a maximum of (\d+) (\w+) items in (\w+). You have already ordered $annualOrdered and can not order any more.', 'You can order a maximum of (\d+) (\w+) items in (\w+). You have already ordered $annualOrdered and can only order (\d+) more.', 'You can order a maximum of (\d+) (\w+) title (\w+) in a fiscal year. You have already ordered (\d+) and can not order any more.', 'You can order a maximum of (\d+) (\w+) title (\w+) in a fiscal year. You have already ordered (\d+) and can only order (\d+) more.', 'There is a limit on the number of times you may request this (\w+) product. The quantity in your cart of product (\w+) exceeds the maximum number of allowable requests.', ); $matches = array(); $count = 0; foreach ($source as $pattern) { if (preg_match('/' . $pattern . '/', $message, $matches)) { array_shift($matches); str_replace(array('(\w+)', '(\d+)'), array('@variable', '@variable'), $pattern, $count); $t_variables = array(); for ($i = 0; $i < $count; $i++) { $t_variable = '@variable' . $i; str_replace('@variable', $t_variable, $pattern); $t_variables[$t_variable] = $matches[$i]; } return t($pattern, $t_variables); } } } var_dump(_ts_restrictions_translate_ws_message('The maximum quantity allowed for Microsoft title groups is 10 per two-year cycle.'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l56RP
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               '_ts_restrictions_translate_ws_message'
          2        SEND_VAL                                                 'The+maximum+quantity+allowed+for+Microsoft+title+groups+is+10+per+two-year+cycle.'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function _ts_restrictions_translate_ws_message:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 46
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 46
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 45
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 26
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 26
Branch analysis from position: 39
Branch analysis from position: 26
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
filename:       /in/l56RP
function name:  _ts_restrictions_translate_ws_message
number of ops:  48
compiled vars:  !0 = $message, !1 = $source, !2 = $matches, !3 = $count, !4 = $pattern, !5 = $t_variables, !6 = $i, !7 = $t_variable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      ''
    4     1        ASSIGN                                                   !1, <array>
   18     2        ASSIGN                                                   !2, <array>
   19     3        ASSIGN                                                   !3, 0
   20     4      > FE_RESET_R                                       $11     !1, ->46
          5    > > FE_FETCH_R                                               $11, !4, ->46
   21     6    >   INIT_FCALL                                               'preg_match'
          7        CONCAT                                           ~12     '%2F', !4
          8        CONCAT                                           ~13     ~12, '%2F'
          9        SEND_VAL                                                 ~13
         10        SEND_VAR                                                 !0
         11        SEND_REF                                                 !2
         12        DO_ICALL                                         $14     
         13      > JMPZ                                                     $14, ->45
   22    14    >   INIT_FCALL                                               'array_shift'
         15        SEND_REF                                                 !2
         16        DO_ICALL                                                 
   23    17        INIT_FCALL                                               'str_replace'
         18        SEND_VAL                                                 <array>
         19        SEND_VAL                                                 <array>
         20        SEND_VAR                                                 !4
         21        SEND_REF                                                 !3
         22        DO_ICALL                                                 
   24    23        ASSIGN                                                   !5, <array>
   25    24        ASSIGN                                                   !6, 0
         25      > JMP                                                      ->37
   26    26    >   CONCAT                                           ~19     '%40variable', !6
         27        ASSIGN                                                   !7, ~19
   27    28        INIT_FCALL                                               'str_replace'
         29        SEND_VAL                                                 '%40variable'
         30        SEND_VAR                                                 !7
         31        SEND_VAR                                                 !4
         32        DO_ICALL                                                 
   28    33        FETCH_DIM_R                                      ~23     !2, !6
         34        ASSIGN_DIM                                               !5, !7
         35        OP_DATA                                                  ~23
   25    36        PRE_INC                                                  !6
         37    >   IS_SMALLER                                               !6, !3
         38      > JMPNZ                                                    ~25, ->26
   30    39    >   INIT_FCALL_BY_NAME                                       't'
         40        SEND_VAR_EX                                              !4
         41        SEND_VAR_EX                                              !5
         42        DO_FCALL                                      0  $26     
         43        FE_FREE                                                  $11
         44      > RETURN                                                   $26
   20    45    > > JMP                                                      ->5
         46    >   FE_FREE                                                  $11
   33    47      > RETURN                                                   null

End of function _ts_restrictions_translate_ws_message

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.79 ms | 1403 KiB | 22 Q