3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = [ // Almada '274' => [2800, 2804, 2805, 2809, 2810, 2814, 2815, 2819, 2820, 2821, 2825, 2829, 2925, 2970, 2975], // Alverca '275' => [2600, 2601, 2615, 2616, 2619, 2625, 2626, 2630, 2634], // Amadora '276' => [2610, 2614, 2650, 2654, 2700, 2704, 2720, 2724, 2745], // Aveiro '279' => [3800, 3804, 3810, 3814, 3830, 3840, 3850, 3860, 3865, 3865, 3870], // Barreiro //'281' => [2830, 2834, 2835, 2839, 2860, 2864], // Benfica '282' => [1500, 1675, 1685], // Bomucesso '283' => [4050, 4099, 4100, 4149, 4150], // Braga '284' => [4700, 4704, 4705, 4709, 4710, 4714, 4715, 4719, 4720, 4730, 4750, 4755, 4830], // CaldasDaRainha '312' => [2040, 2460, 2475, 2500, 2504, 2510, 2520, 2525, 2540], // CampoGrande '286' => [1600, 1700, 1749, 1750], // Carcavelos '287' => [2645, 2649, 2750, 2754, 2755, 2756, 2765, 2769, 2775, 2779, 2780, 2785, 2789], // Coimbra '289' => [3000, 3004, 3020, 3025, 3030, 3034, 3040, 3044, 3045, 3049, 3050, 3054, 3060, 3064, 3140, 3150], // Constituicao '277' => [4000, 4049, 4200, 4249, 4250, 4300, 4349, 4350, 4369], // Covilha '310' => [6200, 6201, 6215, 6225, 6230], // Expo '290' => [1800, 1849, 1900, 1949, 1950, 1959, 1990, 1998, 1999, 2660, 2664, 2670, 2674, 2680, 2681, 2685, 2689, 2690, 2691, 2694, 2695, 2699], // Famalicao '291' => [4760, 4764, 4770], // Faro '311' => [8000, 8004, 8005, 8009, 8100, 8125, 8135, 8150, 8700, 8800], // Funchal '309' => [9000, 9004, 9020, 9024, 9050, 9054, 9060, 9064], // Gaia '293' => [4400, 4404, 4405, 4409, 4410, 4414, 4415, 4430, 4434], // Gondomar '321' => [4420, 4435, 4440, 4445, 4510, 4515, 4560, 4564], // Guimaraes '294' => [4765, 4800, 4804, 4805, 4809, 4810, 4814, 4815, 4835, 4839], // Leiria '295' => [2400, 2404, 2405, 2410, 2414, 2415, 2419, 2420, 2424, 2425, 2430, 2435, 2445, 2490, 2495, 2499], // LindaAVelha '296' => [1400, 1495, 2730, 2740, 2760, 2770, 2790, 2795, 2799], // Maia '298' => [4425, 4470, 4471, 4474, 4475, 4477, 4479], // Matosinhos '299' => [4450, 4454, 4455, 4460, 4464, 4465], // Paivas '300' => [2840, 2844, 2845, 2855, 2865], // PovoaDeVarzim '301' => [4480, 4484, 4485, 4486, 4490, 4495, 4570, 4740, 4775], // Saldanha '324' => [1050, 1070, 1100, 1150, 1170, 1200, 1250, 1300, 1350, 1700, 1900, 1950], // Setubal '304' => [3700, 3701, 3720, 3730, 3880, 3884, 3885, 4500, 4505, 4520, 4535, 4540], // SJoaoDMadeira '320' => [2900, 2904, 2910, 2914, 2929, 2950, 2951, 2954, 2955, 2959, 2965], // TorresVedras '318' => [2530, 2550, 2560, 2565, 2580, 2581], // VilaReal '306' => [4870, 4880, 5000, 5004, 5030, 5040, 5050, 5060, 5070, 5085, 5090, 5450], // Viseu '307' => [3500, 3504, 3505, 3510, 3514, 3515, 3519, 3520, 3530, 3550, 3560, 3600, 3650, 3660, 3670], ]; #print_r( implode( '|', call_user_func_array('array_merge', $x ) ) ); preg_match( '/<wsi_dist_center_option>(?<keyId>.*?)\<\/wsi_dist_center_option>/', '<wsi_dist_center_option>2</wsi_dist_center_option><elettronica>false</elettronica><supermercati>true', $found ); print_r($found);
based on gAhiJ
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => <wsi_dist_center_option>2</wsi_dist_center_option> [keyId] => 2 [1] => 2 )
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/VQvcp on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/VQvcp on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/VQvcp on line 3
Process exited with code 255.