3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [7908,9861,6033,10179,9023,8711,8712,8731,8767,8528,8635,9249,8797,7686,9077,7400,9664,9325,8994,8997,10001,9277,8401,8718,9159,10088,9487,9482,10486,8652,9982,9070,8651,9919,9109,9191,10759,10474,2877,9065,8579,8621,8445,7484,8967,10112,6190,9029,3645,8433,9121,8429,9183,8595,8864,8943,8667,8669,7687,8406,10449,9537,6122,9228,7942,8729,8478,8670,7714,8691,9843,7354,4086,8985,8606,9043,9108,9197,9008,8633,8836,8591,9171,9082,9506,8827,8844,8721,8537,8543,8697,8634,9256,9251,8802,9541,9316,9352,7358,7362,7366,9289,8596,8705,8689,8809,3307,10104,8958,1935,3695,10492,3585,7906,9835,10696,10695,9313,3925,10703,1065,9846,8684,8442,4085,2420,6764,10741,9312,10340,3495,8763,9396,4095,8938,9373,9370,9949,8534,7143,7144,7148,7151,7158,7162,9051,9031,8747,9217,9214,8987,8823,8600,9301,8739,8525,8841,9654,9319,8963,9150,1820,8132,8415,8407,3306,9418,8604,8584,4623,2872,7299,7991,975,8565,9451,2541,3629,3997,7796,1152,4612,1062,947,6364,8501,2553,3728,10286,2568,5686,7935,3608,9402,9139,9424,8571,9784,8939,8241,9123,7418,4389,7202,2182,9032,5099,3304,3127,9795,9794,8607,8611,7383,1812,998,8535,8951,9391,1677,9174,9173,8816,8622,8769,8770,9275,9274,7576,9219,8842,8887,9145,8666,8738,8735,9039,3074,7917,9006,9072,6898,8560,9306,9215,9040,5926,5389,5066,8399,7481,2385,3305,9154,2875,1606,1617,10410,1088,8572,8886,2572,945,3984,4874,10454,8858,3767,5451,5462,6012,5675,5661,5682,5666,10496,2524,8438,3699,3702,3700,10678,10679,10682,9930,7789,4506,9503,1166,4785,4809,2621,8216,4676,5736,7559,978,3987,8698,4511,4667,10339,9443,9445,9441,10745,10746,9446,8551,4369,3099,6355,3575,2434,10758,1760,1758,10761,10760,10762,6360,10765,8709,9026,9343,2188,8948,2573,8805,8806,2481,3571,3012,9785,10485,7377,10699,2480,2675,2482,4102,9066,10402,9804,10763,9932,9206,4957,4959,8198,2163,9329,8000,3122,7394,9797,1815,1857,1844,8949,9120,4478,7426,8623,9255,10369,9714,2567,6286,3664,1125,3698,4336,1153,5391,3999,8620,1002,9311,4958,1612,9400,9155,8589,9104,9146,1911,9952,9067,9192,9060,8946,2804,10469,6900,10694,8227,1107,1102,1103,3809,10453,9024,8824,9083,2461,6127,2763,9094,7894,9417,2904,3992,8614,9177,8849,8872,1628,6201,6897,5150,4862,5691,3697,6807,8402,10736,5301,8924,7153,9651,7450,9688,9711,9708,4966,2972,9706,9548,8743,8093,3994,10482,1071,7425,9025,7414,4967,10737,2564,7370,9266,8964,2908,7378,9234,8639,2566,7363,1908,9022,7419,9754,9627,9928,9063,8920,9637,9752,8476]; $count = count(explode(',', $arr)); echo $count;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /in/vP8i8:4 Stack trace: #0 /in/vP8i8(4): explode(',', Array) #1 {main} thrown in /in/vP8i8 on line 4
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /in/vP8i8:4 Stack trace: #0 /in/vP8i8(4): explode(',', Array) #1 {main} thrown in /in/vP8i8 on line 4
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: explode() expects parameter 2 to be string, array given in /in/vP8i8 on line 4 Warning: count(): Parameter must be an array or an object that implements Countable in /in/vP8i8 on line 4 0
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
Warning: explode() expects parameter 2 to be string, array given in /in/vP8i8 on line 4 0

preferences:
194.35 ms | 402 KiB | 204 Q