3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $campaignIds = json_decode('[358271,368381,353042,591244,639687,639688,639689,636576,636495,636291,636375,636277,636475,636485,636384,636290,638617,636482,636477,636476,636556,636293,636484,636555,636478,636296,636295,636318,636351,636465,636463,636382,636457,636363,636248,636333,636427,636283,636546,636425,636458,636574,636369,636411,636589,636595,636309,636263,636403,636381,636317,636506,636490,636491,636488,636486,636545,636310,636407,636489,636481,636497,636524,636570,636592,636357,636350,636594,636305,636566,636557,636601,636569,636289,636294,636568,636600,636588,636344,636522,636521,636410,636292,636316,636319,636320,636551,636483,636376,636467,636474,636549,636355,636303,636431,636515,636448,636383,636404,636275,636503,636494,636370,636550,636581,636315,636374,636456,636602,636284,636334,636262,636547,636541,636543,636258,636269,636539,636259,636260,636261,636540,636544,636459,636392,636464,636562,636526,636437,636420,636400,636585,636525,636511,636278,636379,636412,636438,636504,636280,636598,636285,636311,636587,636346,636378,636304,636523,636297,636325,636286,636416,636419,636331,636418,636356,636507,636554,636573,636377,636313,636492,636512,636462,636597,636445,636397,636270,636399,636401,636532,636499,636553,636413,636354,636558,636559,636373,636417,636247,636453,636509,636586,636580,636583,636582,636591,636552,636360,636326,636450,636479,636584,636348,636271,636435,636322,636352,636444,636402,636287,636279,636386,636561,636575,636473,636432,636470,636436,636264,636422,636368,636330,636250,636452,636498,636421,636537,636409,636255,636252,636253,636256,636571,636321,636599,636299,636567,636565,636415,636306,636274,636466,636447,636441,636577,636434,636372,636265,636430,636443,636516,636266,636535,636578,636364,636534,636520,636517,636536,636440,636530,636347,636300,636433,636439,636446,636579,636267,636380,636480,636461,636276,636513,636514,636596,636493,636345,636593,636361,636251,636366,636590,636423,636324,636442,636308,636395,636510,636496,636564,636281,636312,636336,636472,636272,636538,636338,636359,636273,636542,636268,636449,636298,636341,636389,636505,636454,636282,636469,636560,636468,636531,636471,636455,636528,636396,636487,636398,636249,636314,636548,636390,636508,636337,636429,636391,636414,636502,636340,636405,636353,636572,636533,636307,636302,636406,636254,636394,636451,636385,636367,636371,636387,636428,636329,636408,636362,636388,636501,636339,636323,636328,636335,636327,636365,636343,636301,636529,636500,636527,636257,636332,636519,636518,636460,636358,636393,636424,636288,636563,636349,636342,636426,635585,635287,635552,635604,635409,635521,635421,635522,638709,635459,635362,635462,635560,635458,635543,638715,635360,635279,635523,635483,635550,635547,635420,635429,635592,635475,635580,635493,635450,635344,635496,635431,635432,635516,635275,635595,635466,635598,635338,635425,635347,635321,635315,635341,635304,635339,635343,635445,635286,635340,635350,635342,635353,635288,635594,635505,635502,635597,635562,635577,635477,635571,635539,635526,635537,635576,635596,635441,635418,635377,635574,635380,635473,635520,635531,635470,635317,635352,635605,635299,635382,635410,635583,635500,635280,635291,635422,635276,635306,635316,635303,635601,635332,635349,635468,635513,635428,635572,635587,635355,635309,635568,635484,635558,635311,635310,635553,638706,635312,635308,635313,635564,638708,635525,635549,635373,635499,635378,635402,635277,635440,638445,635281,635524,635541,635501,635301,635376,635345,639710,639711,639716,639719,639708,639712,639721,639715,639717,639714,639709,639720,639713,639718,635599,635449,635465,635566,635581,635519,635452,635379,635368,635438,635443,635575,635356,635578,635453,635510,635329,635400,635399,635514,635454,635351,635319,635545,635570,635486,635296,635375,635381,635326,635383,635318,635411,635292,635512,635370,635554,635603,638714,635478,635423,635327,635565,635398,635563,635544,635509,635540,638707,635548,635442,635476,635390,635439,635456,635480,635487,635584,635444,635295,635542,635372,635434,635363,635590,635302,638446,635588,635534,635404,635600,635365,638711,635414,635323,635407,635386,635305,635527,635464,635463,635528,635331,635448,635457,635538,635389,635435,635436,635593,635556,635392,635489,635388,635589,635602,638710,635591,635492,635366,635387,635396,635517,635385,635474,635535,635369,635490,635491,635497,635561,638713,635488,635391,635395,635374,635518,635546,635557,635460,635283,635482,635569,635330,635419,635567,635507,635533,635515,635551,635406,635337,635485,635467,635529,635328,635290,635451,635346,635469,635416,635455,635394,635481,635354,635314,635371,635573,635532,635461,635403,635334,635427,635348,635289,635555,635335,635393,635559,635424,635405,635336,635320,635401,635479,635471,638712,635586,635325,635417,635361,635437,635284,635278,635582,635285,635503,635333,635384,635446,635415,635294,635472,635426,635430,635606,635607,635495,635367,635300,635511,635433,635322,635397,635298,635358,635357,635359,635508,635408,635447,635297,635293,635498,635530,635364,635412,635324,635506,635282,635494,635536,635307,635504,635413,635579,358268,358269,353032,358270,358272,358273,353033,353034,353035,353036,358274,358275,353037,358246,358247,353038,358248,358249,358250,353039,353040,358251,358252,358253,358254,353041,355118,355120,356898,356899,353043,621395,356900,356901,358146,356902,353044,596254,353045,353046,409336,353047,358147,356903,595709,353048,356385,369748,362287,529262]'); $limit=100;echo count($capaignIds).PHP_EOL; $blocksCount = count($campaignIds) / $limit; for ($i = 0; $i < $blocksCount; $i++) { echo count((array_slice($campaignIds, $blocksCount * $i, $limit))).PHP_EOL; }
based on NXcCP
Output for 5.2.0 - 7.1.0
Notice: Undefined variable: capaignIds in /in/rMS3Y on line 3 0 100 100 100 100 100 100 100 100
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/rMS3Y on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/rMS3Y on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/rMS3Y on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/rMS3Y on line 2