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(); foreach ($source as $pattern){ if(preg_match('/'.$pattern.'/', $message, $matches)){ break; } } die(var_dump($matches)); } _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/BC75k
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               '_ts_restrictions_translate_ws_message'
          1        SEND_VAL                                                 'The+maximum+quantity+allowed+for+Microsoft+title+groups+is+10+per+two-year+cycle.'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function _ts_restrictions_translate_ws_message:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 15
filename:       /in/BC75k
function name:  _ts_restrictions_translate_ws_message
number of ops:  21
compiled vars:  !0 = $message, !1 = $source, !2 = $matches, !3 = $pattern
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      > FE_RESET_R                                       $6      !1, ->15
          4    > > FE_FETCH_R                                               $6, !3, ->15
   20     5    >   INIT_FCALL                                               'preg_match'
          6        CONCAT                                           ~7      '%2F', !3
          7        CONCAT                                           ~8      ~7, '%2F'
          8        SEND_VAL                                                 ~8
          9        SEND_VAR                                                 !0
         10        SEND_REF                                                 !2
         11        DO_ICALL                                         $9      
         12      > JMPZ                                                     $9, ->14
   21    13    > > JMP                                                      ->15
   19    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $6
   25    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $10     
         19      > EXIT                                                     $10
   27    20*     > RETURN                                                   null

End of function _ts_restrictions_translate_ws_message

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.43 ms | 1399 KiB | 18 Q