3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = '{"relays_published":"2013-12-21 01:00:00", "relays":[ {"fingerprint":"9A785788015257CEE6DBC184B76CDEA24B19ADAB", "write_history":{ "3_days":{"first":"2013-12-17 12:22:30","last":"2013-12-20 11:37:30","interval":900,"factor":3896.316,"count":286,"values":[408,413,357,429,488,527,525,547,452,434,395,431,435,536,523,446,470,462,480,541,534,469,483,654,507,502,393,471,437,384,324,396,496,604,442,376,333,357,354,387,374,397,199,335,361,355,330,235,229,225,385,417,302,408,208,162,182,215,219,224,259,269,458,352,237,233,242,170,293,321,341,365,351,441,428,326,376,374,273,262,181,273,280,298,268,463,380,317,321,363,533,558,588,450,438,308,398,407,338,434,388,430,392,460,444,420,495,652,551,457,463,470,460,422,463,568,617,555,474,431,443,407,379,387,435,499,464,548,456,341,453,464,598,669,349,363,422,491,634,508,238,359,355,295,325,335,491,454,299,259,435,277,475,444,294,320,290,227,256,172,219,251,340,284,236,250,297,272,822,723,455,494,268,413,297,254,398,368,244,309,269,258,445,370,493,444,309,326,319,376,374,557,418,487,474,512,500,415,483,751,999,671,531,592,618,574,620,481,419,511,547,588,937,847,679,658,793,706,553,528,356,398,320,440,429,532,314,514,509,431,512,487,441,358,278,349,370,354,358,339,414,331,380,306,441,275,345,487,243,120,137,236,184,204,246,250,263,229,327,320,425,639,563,849,472,489,484,416,536,452,308,407,405,361,417,557,378,528,496,663,557,482,265,405,443,383]}, "1_week":{"first":"2013-12-13 12:30:00","last":"2013-12-20 11:30:00","interval":3600,"factor":2976.697,"count":168,"values":[331,382,416,423,574,643,422,553,512,480,514,589,387,568,305,391,449,481,486,516,558,452,520,501,524,472,528,396,621,392,364,408,479,542,732,638,510,601,639,561,528,711,582,487,589,459,429,503,519,443,677,665,698,546,689,779,705,362,371,291,405,389,328,179,234,299,240,290,316,285,330,413,303,262,288,549,638,601,482,641,568,582,572,629,735,587,323,381,561,514,542,428,458,602,473,494,526,644,598,630,608,663,673,529,634,465,444,452,352,437,255,396,348,368,519,442,326,461,502,666,475,538,595,695,594,724,544,584,588,681,625,478,474,474,488,358,321,349,743,482,414,419,529,457,634,625,966,787,641,999,887,524,561,644,512,468,480,447,323,285,350,637,751,560,521,641,644,537]}, "1_month":{"first":"2013-12-04 06:00:00","last":"2013-12-20 10:00:00","interval":14400,"factor":2273.542,"count":98,"values":[0,0,0,1,2,2,1,10,19,15,26,28,12,11,24,114,106,63,102,127,70,95,104,70,63,120,126,259,257,172,194,358,384,274,89,0,0,0,106,279,265,274,268,293,323,415,455,319,433,463,489,567,672,527,381,522,508,718,686,541,633,665,628,584,783,756,755,648,754,888,566,426,348,440,459,773,769,663,669,663,785,810,653,471,549,640,754,801,777,587,621,595,986,999,715,503,752,771]} }, "read_history":{ "3_days":{"first":"2013-12-17 12:22:30","last":"2013-12-20 11:37:30","interval":900,"factor":3778.206,"count":286,"values":[406,409,347,419,482,521,520,536,443,423,385,420,424,528,512,430,457,452,470,527,526,460,474,639,495,488,376,456,427,373,312,380,488,596,431,364,324,350,343,376,369,392,192,327,354,350,323,226,220,218,379,409,296,403,203,155,177,212,214,217,254,266,458,350,235,229,233,167,290,315,338,359,345,436,424,318,372,369,266,250,170,264,271,290,260,457,375,309,310,356,527,546,579,442,430,302,387,393,324,417,374,416,379,455,438,414,493,652,543,442,448,452,441,408,453,563,616,549,462,413,431,394,366,381,423,485,447,528,437,325,436,449,585,657,334,350,412,484,629,499,231,352,348,287,320,327,486,453,296,256,432,268,470,440,286,304,278,220,253,168,214,246,333,279,229,242,289,265,817,718,450,484,260,406,289,242,391,361,235,297,260,246,436,360,488,436,301,313,311,369,369,559,410,478,462,496,487,405,483,744,999,656,510,568,604,556,602,469,409,489,528,563,926,834,662,637,780,694,540,522,350,391,302,426,419,522,308,509,508,426,508,482,436,348,271,339,366,350,355,338,416,333,378,301,418,258,334,485,240,118,135,231,180,199,239,242,260,224,324,316,419,637,563,855,473,487,485,414,532,447,303,401,398,352,407,548,369,521,485,653,546,473,253,392,432,372]}, "1_week":{"first":"2013-12-13 12:30:00","last":"2013-12-20 11:30:00","interval":3600,"factor":2824.674,"count":168,"values":[335,388,422,430,585,659,428,566,523,490,524,597,391,581,311,398,457,490,495,527,563,459,527,508,534,480,539,405,635,399,368,415,479,545,741,651,514,610,647,570,534,720,589,490,593,457,422,494,510,431,673,660,693,548,686,778,712,354,371,292,410,393,328,175,232,300,237,288,313,282,326,414,300,259,289,558,643,612,478,645,577,585,576,638,750,594,324,383,571,519,545,427,461,607,476,492,530,650,597,630,605,664,668,525,634,462,445,453,349,439,254,400,350,371,523,443,319,462,502,668,470,531,602,698,587,732,536,581,578,677,627,478,475,481,489,353,321,347,753,481,411,414,530,456,638,626,973,779,634,999,887,523,560,653,514,472,490,439,327,284,351,647,769,567,521,644,644,534]}, "1_month":{"first":"2013-12-04 06:00:00","last":"2013-12-20 10:00:00","interval":14400,"factor":2151.826,"count":98,"values":[0,0,0,1,2,3,1,10,19,16,26,29,13,11,25,117,108,63,104,128,72,97,106,72,65,123,129,263,264,178,196,367,393,282,91,0,0,0,109,285,269,278,274,300,330,425,465,323,443,468,500,579,688,537,389,533,517,735,700,552,646,675,643,596,793,769,766,646,747,888,568,429,347,438,461,780,780,673,677,669,790,808,654,473,554,641,755,800,775,590,625,594,990,999,722,505,766,773]} }} ], "bridges_published":"2013-12-21 00:37:04", "bridges":[ ]}'; $decodedData = json_decode($data, true); $relays = $decodedData['relays']; $firstRelay = reset($relays); print_r($firstRelay['write_history']['3_days']['values']);
Output for 5.2.0 - 7.1.0
Array ( [0] => 408 [1] => 413 [2] => 357 [3] => 429 [4] => 488 [5] => 527 [6] => 525 [7] => 547 [8] => 452 [9] => 434 [10] => 395 [11] => 431 [12] => 435 [13] => 536 [14] => 523 [15] => 446 [16] => 470 [17] => 462 [18] => 480 [19] => 541 [20] => 534 [21] => 469 [22] => 483 [23] => 654 [24] => 507 [25] => 502 [26] => 393 [27] => 471 [28] => 437 [29] => 384 [30] => 324 [31] => 396 [32] => 496 [33] => 604 [34] => 442 [35] => 376 [36] => 333 [37] => 357 [38] => 354 [39] => 387 [40] => 374 [41] => 397 [42] => 199 [43] => 335 [44] => 361 [45] => 355 [46] => 330 [47] => 235 [48] => 229 [49] => 225 [50] => 385 [51] => 417 [52] => 302 [53] => 408 [54] => 208 [55] => 162 [56] => 182 [57] => 215 [58] => 219 [59] => 224 [60] => 259 [61] => 269 [62] => 458 [63] => 352 [64] => 237 [65] => 233 [66] => 242 [67] => 170 [68] => 293 [69] => 321 [70] => 341 [71] => 365 [72] => 351 [73] => 441 [74] => 428 [75] => 326 [76] => 376 [77] => 374 [78] => 273 [79] => 262 [80] => 181 [81] => 273 [82] => 280 [83] => 298 [84] => 268 [85] => 463 [86] => 380 [87] => 317 [88] => 321 [89] => 363 [90] => 533 [91] => 558 [92] => 588 [93] => 450 [94] => 438 [95] => 308 [96] => 398 [97] => 407 [98] => 338 [99] => 434 [100] => 388 [101] => 430 [102] => 392 [103] => 460 [104] => 444 [105] => 420 [106] => 495 [107] => 652 [108] => 551 [109] => 457 [110] => 463 [111] => 470 [112] => 460 [113] => 422 [114] => 463 [115] => 568 [116] => 617 [117] => 555 [118] => 474 [119] => 431 [120] => 443 [121] => 407 [122] => 379 [123] => 387 [124] => 435 [125] => 499 [126] => 464 [127] => 548 [128] => 456 [129] => 341 [130] => 453 [131] => 464 [132] => 598 [133] => 669 [134] => 349 [135] => 363 [136] => 422 [137] => 491 [138] => 634 [139] => 508 [140] => 238 [141] => 359 [142] => 355 [143] => 295 [144] => 325 [145] => 335 [146] => 491 [147] => 454 [148] => 299 [149] => 259 [150] => 435 [151] => 277 [152] => 475 [153] => 444 [154] => 294 [155] => 320 [156] => 290 [157] => 227 [158] => 256 [159] => 172 [160] => 219 [161] => 251 [162] => 340 [163] => 284 [164] => 236 [165] => 250 [166] => 297 [167] => 272 [168] => 822 [169] => 723 [170] => 455 [171] => 494 [172] => 268 [173] => 413 [174] => 297 [175] => 254 [176] => 398 [177] => 368 [178] => 244 [179] => 309 [180] => 269 [181] => 258 [182] => 445 [183] => 370 [184] => 493 [185] => 444 [186] => 309 [187] => 326 [188] => 319 [189] => 376 [190] => 374 [191] => 557 [192] => 418 [193] => 487 [194] => 474 [195] => 512 [196] => 500 [197] => 415 [198] => 483 [199] => 751 [200] => 999 [201] => 671 [202] => 531 [203] => 592 [204] => 618 [205] => 574 [206] => 620 [207] => 481 [208] => 419 [209] => 511 [210] => 547 [211] => 588 [212] => 937 [213] => 847 [214] => 679 [215] => 658 [216] => 793 [217] => 706 [218] => 553 [219] => 528 [220] => 356 [221] => 398 [222] => 320 [223] => 440 [224] => 429 [225] => 532 [226] => 314 [227] => 514 [228] => 509 [229] => 431 [230] => 512 [231] => 487 [232] => 441 [233] => 358 [234] => 278 [235] => 349 [236] => 370 [237] => 354 [238] => 358 [239] => 339 [240] => 414 [241] => 331 [242] => 380 [243] => 306 [244] => 441 [245] => 275 [246] => 345 [247] => 487 [248] => 243 [249] => 120 [250] => 137 [251] => 236 [252] => 184 [253] => 204 [254] => 246 [255] => 250 [256] => 263 [257] => 229 [258] => 327 [259] => 320 [260] => 425 [261] => 639 [262] => 563 [263] => 849 [264] => 472 [265] => 489 [266] => 484 [267] => 416 [268] => 536 [269] => 452 [270] => 308 [271] => 407 [272] => 405 [273] => 361 [274] => 417 [275] => 557 [276] => 378 [277] => 528 [278] => 496 [279] => 663 [280] => 557 [281] => 482 [282] => 265 [283] => 405 [284] => 443 [285] => 383 )
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/GYhno on line 21
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/GYhno on line 21
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/GYhno on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/GYhno on line 21