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.'));
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function t() in /in/l56RP:30 Stack trace: #0 /in/l56RP(36): _ts_restrictions_translate_ws_message('The maximum qua...') #1 {main} thrown in /in/l56RP on line 30
Process exited with code 255.
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Call to undefined function t() in /in/l56RP on line 30
Process exited with code 255.

preferences:
170.7 ms | 402 KiB | 226 Q