3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zipString = '8239;8252;8253;8254;8255;8259;8261;8262;8263;8467;8468;8476;8477;8525;8526;8537;8000;8001;8002;8003;8004;8005;8006;8010;8012;8015;8016;8020;8021;8022;8023;8024;8026;8027;8030;8031;8033;8034;8036;8037;8039;8040;8042;8044;8045;8046;8047;8048;8049;8050;8051;8052;8055;8057;8058;8059;8060;8061;8063;8064;8065;8066;8068;8070;8071;8074;8075;8080;8081;8085;8086;8087;8088;8090;8091;8092;8093;8096;8098;8099;8102;8103;8104;8105;8106;8107;8108;8112;8113;8114;8115;8142;8152;8153;8154;8155;8156;8157;8158;8162;8164;8165;8166;8172;8173;8174;8175;8180;8181;8182;8184;8185;8187;8192;8193;8194;8195;8196;8197;8201;8202;8203;8204;8205;8207;8208;8210;8212;8213;8214;8215;8216;8217;8218;8219;8222;8223;8224;8225;8226;8228;8231;8232;8233;8234;8235;8236;8240;8241;8242;8243;8245;8246;8247;8248;8302;8303;8304;8305;8306;8307;8309;8310;8311;8312;8314;8315;8317;8352;8353;8354;8355;8356;8357;8400;8401;8402;8404;8405;8406;8408;8409;8410;8411;8412;8413;8414;8415;8416;8418;8421;8422;8424;8425;8426;8427;8428;8442;8444;8447;8450;8451;8452;8453;8454;8455;8457;8458;8459;8460;8461;8462;8463;8464;8465;8466;8471;8472;8474;8475;8478;8479;8482;8483;8522;8523;8542;8543;8544;8545;8546;8547;8548;8600;8602;4900;4901;4902;4911;4912;4913;4914;4915;4916;4922;4923;8865;8866;8867;8868;8872;8873;8874;8877;8878;8880;7320;8008;8011;8032;8038;8041;8053;8109;8117;8118;8121;8122;8123;8124;8125;8126;8127;8130;8132;8133;8134;8135;8136;8143;8200;8301;8308;8320;8322;8330;8331;8332;8335;8340;8342;8343;8344;8345;8360;8362;8363;8370;8372;8374;8376;8484;8486;8487;8488;8489;8492;8493;8494;8495;8496;8497;8498;8499;8603;8604;8605;8606;8607;8608;8610;8612;8613;8614;8615;8616;8617;8618;8620;8621;8622;8623;8624;8625;8626;8627;8630;8632;8633;8634;8635;8636;8637;8638;8639;8640;8645;8646;8700;8702;8703;8704;8706;8707;8708;8712;8713;8714;8715;8716;8717;8718;8722;8723;8725;8726;8727;8730;8732;8733;8734;8735;8737;8738;8739;8740;8800;8801;8802;8803;8804;8805;8806;8807;8808;8810;8812;8813;8815;8820;8750;8752;8753;8754;8755;8756;8757;8758;8881;8882;8883;8884;8885;8886;8887;8888;8889;8890;8892;8893;8894;8895;8896;8897;8898;8832;8835;8844;8845;8846;8847;8852;8853;8854;8855;8856;8857;8858;8862;8863;8864;4302;4303;4304;4305;4310;4312;4313;4314;4315;4316;4317;4322;4323;4324;4325;4332;4333;4334;4600;4601;4603;4609;4612;4613;4614;4615;4616;4617;4618;4622;4623;4624;4625;4626;4628;4629;4632;4633;4634;4652;4653;4654;4655;4656;4657;4658;4663;4665;4702;4703;4704;4710;4717;4718;4719;4800;4801;4802;4803;4805;4806;4807;4808;4809;4812;4813;4814;4852;4853;4856;5000;5010;5012;5013;5014;5015;5017;5018;5022;5023;5024;5025;5026;5027;5028;5032;5033;5034;5035;5036;5037;5040;5042;5043;5044;5046;5053;5054;5056;5057;5058;5062;5063;5064;5070;5072;5073;5074;5075;5076;5077;5078;5079;5080;5082;5083;5084;5085;5102;5103;5105;5106;5107;5108;5112;5113;5116;5200;5201;5210;5212;5213;5222;5223;5224;5225;5232;5233;5234;5235;5236;5237;5242;5243;5244;5245;5246;5272;5273;5274;5275;5276;5277;5300;5301;5303;5304;5305;5306;5312;5313;5314;5315;5316;5317;5318;5322;5323;5324;5325;5326;5330;5332;5333;5334;5400;5404;5405;5406;5408;5412;5413;5415;5416;5417;5420;5423;5425;5426;5430;5431;5432;5436;5442;5443;5444;5445;5452;5453;5454;5462;5463;5464;5465;5466;5467;5502;5503;5504;5505;5506;5507;5510;5512;5522;5524;5525;5600;5601;5603;5604;5605;5606;5607;5608;5610;5611;5612;5613;5614;5615;5616;5617;5618;5619;5620;5621;5622;5623;5624;5625;5626;5627;5628;5630;5632;5634;5636;5637;5642;5643;5644;5645;5646;5647;5702;5703;5704;5705;5706;5707;5708;5712;5722;5723;5724;5725;5726;5727;5728;5732;5733;5734;5735;5736;5737;5742;5745;5746;6024;6025;6026;6027;6028;6034;6038;6042;6145;6146;6147;6211;6215;6221;6222;6231;6232;6233;6234;6235;6236;6244;6245;6246;6252;6253;6260;6262;6263;6264;6265;6277;6280;6281;6283;6284;6285;6286;6287;6288;6289;6294;6295;8901;8902;8903;8904;8905;8906;8907;8908;8909;8910;8911;8912;8913;8916;8917;8918;8919;8942;8951;8952;8953;8954;8955;8956;8957;8962;8964;8965;8966;8967;8970;4402;4410;4411;4412;4413;4414;4415;4416;4417;4418;4419;4421;4422;4423;4424;4425;4426;4431;4432;4433;4434;4435;4436;4437;4438;4441;4442;4443;4444;4445;4446;4447;4448;4450;4451;4452;4453;4455;4456;4457;4458;4460;4461;4462;4463;4464;4465;4466;4467;4468;4469;4492;4493;4494;4495;4496;4497;6274;6275;6276;6300;6301;6302;6303;6304;6310;6312;6313;6314;6315;6317;6318;6319;6330;6331;6332;6333;6340;6343;6344;6345;6405;6410;6414;6415;6416;6417;6418;6422;6423;6424;6430;6431;6432;6433;6434;6438;6440;6442;6443;8816;8824;8825;8833;8834;8836;8840;8841;8842;8843;8849;8914;8915;8925;8926;8932;8933;8934;8934'; $zips = array_unique(array_map(fn(string $zip) => (int) $zip, explode(';', $zipString))); sort($zips); $start = $zips[0]; $ranges = []; foreach ($zips as $i => $zip) { $nextIndex = $i + 1; $nextProjectedZip = $zip + 1; if (!isset($zips[$nextIndex]) || ($nextProjectedZip !== $zips[$nextIndex])) { $ranges[] = ['from' => (string) $start, 'to' => (string) ($zip + 1)]; if (isset($zips[$nextIndex])) { $start = (string) $zips[$nextIndex]; } } } echo json_encode($ranges);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 47
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 47
Branch analysis from position: 22
2 jumps found. (Code = 47) Position 1 = 30, Position 2 = 33
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 46
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 46
Branch analysis from position: 46
Branch analysis from position: 33
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/MLQRf
function name:  (null)
number of ops:  53
compiled vars:  !0 = $zipString, !1 = $zips, !2 = $start, !3 = $ranges, !4 = $zip, !5 = $i, !6 = $nextIndex, !7 = $nextProjectedZip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '8239%3B8252%3B8253%3B8254%3B8255%3B8259%3B8261%3B8262%3B8263%3B8467%3B8468%3B8476%3B8477%3B8525%3B8526%3B8537%3B8000%3B8001%3B8002%3B8003%3B8004%3B8005%3B8006%3B8010%3B8012%3B8015%3B8016%3B8020%3B8021%3B8022%3B8023%3B8024%3B8026%3B8027%3B8030%3B8031%3B8033%3B8034%3B8036%3B8037%3B8039%3B8040%3B8042%3B8044%3B8045%3B8046%3B8047%3B8048%3B8049%3B8050%3B8051%3B8052%3B8055%3B8057%3B8058%3B8059%3B8060%3B8061%3B8063%3B8064%3B8065%3B8066%3B8068%3B8070%3B8071%3B8074%3B8075%3B8080%3B8081%3B8085%3B8086%3B8087%3B8088%3B8090%3B8091%3B8092%3B8093%3B8096%3B8098%3B8099%3B8102%3B8103%3B8104%3B8105%3B8106%3B8107%3B8108%3B8112%3B8113%3B8114%3B8115%3B8142%3B8152%3B8153%3B8154%3B8155%3B8156%3B8157%3B8158%3B8162%3B8164%3B8165%3B8166%3B8172%3B8173%3B8174%3B8175%3B8180%3B8181%3B8182%3B8184%3B8185%3B8187%3B8192%3B8193%3B8194%3B8195%3B8196%3B8197%3B8201%3B8202%3B8203%3B8204%3B8205%3B8207%3B8208%3B8210%3B8212%3B8213%3B8214%3B8215%3B8216%3B8217%3B8218%3B8219%3B8222%3B8223%3B8224%3B8225%3B8226%3B8228%3B8231%3B8232%3B8233%3B8234%3B8235%3B8236%3B8240%3B8241%3B8242%3B8243%3B8245%3B8246%3B8247%3B8248%3B8302%3B8303%3B8304%3B8305%3B8306%3B8307%3B8309%3B8310%3B8311%3B8312%3B8314%3B8315%3B8317%3B8352%3B8353%3B8354%3B8355%3B8356%3B8357%3B8400%3B8401%3B8402%3B8404%3B8405%3B8406%3B8408%3B8409%3B8410%3B8411%3B8412%3B8413%3B8414%3B8415%3B8416%3B8418%3B8421%3B8422%3B8424%3B8425%3B8426%3B8427%3B8428%3B8442%3B8444%3B8447%3B8450%3B8451%3B8452%3B8453%3B8454%3B8455%3B8457%3B8458%3B8459%3B8460%3B8461%3B8462%3B8463%3B8464%3B8465%3B8466%3B8471%3B8472%3B8474%3B8475%3B8478%3B8479%3B8482%3B8483%3B8522%3B8523%3B8542%3B8543%3B8544%3B8545%3B8546%3B8547%3B8548%3B8600%3B8602%3B4900%3B4901%3B4902%3B4911%3B4912%3B4913%3B4914%3B4915%3B4916%3B4922%3B4923%3B8865%3B8866%3B8867%3B8868%3B8872%3B8873%3B8874%3B8877%3B8878%3B8880%3B7320%3B8008%3B8011%3B8032%3B8038%3B8041%3B8053%3B8109%3B8117%3B8118%3B8121%3B8122%3B8123%3B8124%3B8125%3B8126%3B8127%3B8130%3B8132%3B8133%3B8134%3B8135%3B8136%3B8143%3B8200%3B8301%3B8308%3B8320%3B8322%3B8330%3B8331%3B8332%3B8335%3B8340%3B8342%3B8343%3B8344%3B8345%3B8360%3B8362%3B8363%3B8370%3B8372%3B8374%3B8376%3B8484%3B8486%3B8487%3B8488%3B8489%3B8492%3B8493%3B8494%3B8495%3B8496%3B8497%3B8498%3B8499%3B8603%3B8604%3B8605%3B8606%3B8607%3B8608%3B8610%3B8612%3B8613%3B8614%3B8615%3B8616%3B8617%3B8618%3B8620%3B8621%3B8622%3B8623%3B8624%3B8625%3B8626%3B8627%3B8630%3B8632%3B8633%3B8634%3B8635%3B8636%3B8637%3B8638%3B8639%3B8640%3B8645%3B8646%3B8700%3B8702%3B8703%3B8704%3B8706%3B8707%3B8708%3B8712%3B8713%3B8714%3B8715%3B8716%3B8717%3B8718%3B8722%3B8723%3B8725%3B8726%3B8727%3B8730%3B8732%3B8733%3B8734%3B8735%3B8737%3B8738%3B8739%3B8740%3B8800%3B8801%3B8802%3B8803%3B8804%3B8805%3B8806%3B8807%3B8808%3B8810%3B8812%3B8813%3B8815%3B8820%3B8750%3B8752%3B8753%3B8754%3B8755%3B8756%3B8757%3B8758%3B8881%3B8882%3B8883%3B8884%3B8885%3B8886%3B8887%3B8888%3B8889%3B8890%3B8892%3B8893%3B8894%3B8895%3B8896%3B8897%3B8898%3B8832%3B8835%3B8844%3B8845%3B8846%3B8847%3B8852%3B8853%3B8854%3B8855%3B8856%3B8857%3B8858%3B8862%3B8863%3B8864%3B4302%3B4303%3B4304%3B4305%3B4310%3B4312%3B4313%3B4314%3B4315%3B4316%3B4317%3B4322%3B4323%3B4324%3B4325%3B4332%3B4333%3B4334%3B4600%3B4601%3B4603%3B4609%3B4612%3B4613%3B4614%3B4615%3B4616%3B4617%3B4618%3B4622%3B4623%3B4624%3B4625%3B4626%3B4628%3B4629%3B4632%3B4633%3B4634%3B4652%3B4653%3B4654%3B4655%3B4656%3B4657%3B4658%3B4663%3B4665%3B4702%3B4703%3B4704%3B4710%3B4717%3B4718%3B4719%3B4800%3B4801%3B4802%3B4803%3B4805%3B4806%3B4807%3B4808%3B4809%3B4812%3B4813%3B4814%3B4852%3B4853%3B4856%3B5000%3B5010%3B5012%3B5013%3B5014%3B5015%3B5017%3B5018%3B5022%3B5023%3B5024%3B5025%3B5026%3B5027%3B5028%3B5032%3B5033%3B5034%3B5035%3B5036%3B5037%3B5040%3B5042%3B5043%3B5044%3B5046%3B5053%3B5054%3B5056%3B5057%3B5058%3B5062%3B5063%3B5064%3B5070%3B5072%3B5073%3B5074%3B5075%3B5076%3B5077%3B5078%3B5079%3B5080%3B5082%3B5083%3B5084%3B5085%3B5102%3B5103%3B5105%3B5106%3B5107%3B5108%3B5112%3B5113%3B5116%3B5200%3B5201%3B5210%3B5212%3B5213%3B5222%3B5223%3B5224%3B5225%3B5232%3B5233%3B5234%3B5235%3B5236%3B5237%3B5242%3B5243%3B5244%3B5245%3B5246%3B5272%3B5273%3B5274%3B5275%3B5276%3B5277%3B5300%3B5301%3B5303%3B5304%3B5305%3B5306%3B5312%3B5313%3B5314%3B5315%3B5316%3B5317%3B5318%3B5322%3B5323%3B5324%3B5325%3B5326%3B5330%3B5332%3B5333%3B5334%3B5400%3B5404%3B5405%3B5406%3B5408%3B5412%3B5413%3B5415%3B5416%3B5417%3B5420%3B5423%3B5425%3B5426%3B5430%3B5431%3B5432%3B5436%3B5442%3B5443%3B5444%3B5445%3B5452%3B5453%3B5454%3B5462%3B5463%3B5464%3B5465%3B5466%3B5467%3B5502%3B5503%3B5504%3B5505%3B5506%3B5507%3B5510%3B5512%3B5522%3B5524%3B5525%3B5600%3B5601%3B5603%3B5604%3B5605%3B5606%3B5607%3B5608%3B5610%3B5611%3B5612%3B5613%3B5614%3B5615%3B5616%3B5617%3B5618%3B5619%3B5620%3B5621%3B5622%3B5623%3B5624%3B5625%3B5626%3B5627%3B5628%3B5630%3B5632%3B5634%3B5636%3B5637%3B5642%3B5643%3B5644%3B5645%3B5646%3B5647%3B5702%3B5703%3B5704%3B5705%3B5706%3B5707%3B5708%3B5712%3B5722%3B5723%3B5724%3B5725%3B5726%3B5727%3B5728%3B5732%3B5733%3B5734%3B5735%3B5736%3B5737%3B5742%3B5745%3B5746%3B6024%3B6025%3B6026%3B6027%3B6028%3B6034%3B6038%3B6042%3B6145%3B6146%3B6147%3B6211%3B6215%3B6221%3B6222%3B6231%3B6232%3B6233%3B6234%3B6235%3B6236%3B6244%3B6245%3B6246%3B6252%3B6253%3B6260%3B6262%3B6263%3B6264%3B6265%3B6277%3B6280%3B6281%3B6283%3B6284%3B6285%3B6286%3B6287%3B6288%3B6289%3B6294%3B6295%3B8901%3B8902%3B8903%3B8904%3B8905%3B8906%3B8907%3B8908%3B8909%3B8910%3B8911%3B8912%3B8913%3B8916%3B8917%3B8918%3B8919%3B8942%3B8951%3B8952%3B8953%3B8954%3B8955%3B8956%3B8957%3B8962%3B8964%3B8965%3B8966%3B8967%3B8970%3B4402%3B4410%3B4411%3B4412%3B4413%3B4414%3B4415%3B4416%3B4417%3B4418%3B4419%3B4421%3B4422%3B4423%3B4424%3B4425%3B4426%3B4431%3B4432%3B4433%3B4434%3B4435%3B4436%3B4437%3B4438%3B4441%3B4442%3B4443%3B4444%3B4445%3B4446%3B4447%3B4448%3B4450%3B4451%3B4452%3B4453%3B4455%3B4456%3B4457%3B4458%3B4460%3B4461%3B4462%3B4463%3B4464%3B4465%3B4466%3B4467%3B4468%3B4469%3B4492%3B4493%3B4494%3B4495%3B4496%3B4497%3B6274%3B6275%3B6276%3B6300%3B6301%3B6302%3B6303%3B6304%3B6310%3B6312%3B6313%3B6314%3B6315%3B6317%3B6318%3B6319%3B6330%3B6331%3B6332%3B6333%3B6340%3B6343%3B6344%3B6345%3B6405%3B6410%3B6414%3B6415%3B6416%3B6417%3B6418%3B6422%3B6423%3B6424%3B6430%3B6431%3B6432%3B6433%3B6434%3B6438%3B6440%3B6442%3B6443%3B8816%3B8824%3B8825%3B8833%3B8834%3B8836%3B8840%3B8841%3B8842%3B8843%3B8849%3B8914%3B8915%3B8925%3B8926%3B8932%3B8933%3B8934%3B8934'
    6     1        INIT_FCALL                                               'array_unique'
          2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMLQRf%3A6%240'
          4        SEND_VAL                                                 ~9
          5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%3B'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $10     
          9        SEND_VAR                                                 $10
         10        DO_ICALL                                         $11     
         11        SEND_VAR                                                 $11
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !1, $12
    7    14        INIT_FCALL                                               'sort'
         15        SEND_REF                                                 !1
         16        DO_ICALL                                                 
    9    17        FETCH_DIM_R                                      ~15     !1, 0
         18        ASSIGN                                                   !2, ~15
   11    19        ASSIGN                                                   !3, <array>
   13    20      > FE_RESET_R                                       $18     !1, ->47
         21    > > FE_FETCH_R                                       ~19     $18, !4, ->47
         22    >   ASSIGN                                                   !5, ~19
   14    23        ADD                                              ~21     !5, 1
         24        ASSIGN                                                   !6, ~21
   15    25        ADD                                              ~23     !4, 1
         26        ASSIGN                                                   !7, ~23
   17    27        ISSET_ISEMPTY_DIM_OBJ                         0  ~25     !1, !6
         28        BOOL_NOT                                         ~26     ~25
         29      > JMPNZ_EX                                         ~26     ~26, ->33
         30    >   FETCH_DIM_R                                      ~27     !1, !6
         31        IS_NOT_IDENTICAL                                 ~28     !7, ~27
         32        BOOL                                             ~26     ~28
         33    > > JMPZ                                                     ~26, ->46
   18    34    >   CAST                                          6  ~30     !2
         35        INIT_ARRAY                                       ~31     ~30, 'from'
         36        ADD                                              ~32     !4, 1
         37        CAST                                          6  ~33     ~32
         38        ADD_ARRAY_ELEMENT                                ~31     ~33, 'to'
         39        ASSIGN_DIM                                               !3
         40        OP_DATA                                                  ~31
   20    41        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !6
         42      > JMPZ                                                     ~34, ->46
   21    43    >   FETCH_DIM_R                                      ~35     !1, !6
         44        CAST                                          6  ~36     ~35
         45        ASSIGN                                                   !2, ~36
   13    46    > > JMP                                                      ->21
         47    >   FE_FREE                                                  $18
   26    48        INIT_FCALL                                               'json_encode'
         49        SEND_VAR                                                 !3
         50        DO_ICALL                                         $38     
         51        ECHO                                                     $38
         52      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMLQRf%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MLQRf
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $zip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        CAST                                          4  ~1      !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMLQRf%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.23 ms | 1408 KiB | 23 Q