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); var_dump($firstRelay['write_history']['3_days']);
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(6) { ["first"]=> string(19) "2013-12-17 12:22:30" ["last"]=> string(19) "2013-12-20 11:37:30" ["interval"]=> int(900) ["factor"]=> float(3896.316) ["count"]=> int(286) ["values"]=> array(286) { [0]=> int(408) [1]=> int(413) [2]=> int(357) [3]=> int(429) [4]=> int(488) [5]=> int(527) [6]=> int(525) [7]=> int(547) [8]=> int(452) [9]=> int(434) [10]=> int(395) [11]=> int(431) [12]=> int(435) [13]=> int(536) [14]=> int(523) [15]=> int(446) [16]=> int(470) [17]=> int(462) [18]=> int(480) [19]=> int(541) [20]=> int(534) [21]=> int(469) [22]=> int(483) [23]=> int(654) [24]=> int(507) [25]=> int(502) [26]=> int(393) [27]=> int(471) [28]=> int(437) [29]=> int(384) [30]=> int(324) [31]=> int(396) [32]=> int(496) [33]=> int(604) [34]=> int(442) [35]=> int(376) [36]=> int(333) [37]=> int(357) [38]=> int(354) [39]=> int(387) [40]=> int(374) [41]=> int(397) [42]=> int(199) [43]=> int(335) [44]=> int(361) [45]=> int(355) [46]=> int(330) [47]=> int(235) [48]=> int(229) [49]=> int(225) [50]=> int(385) [51]=> int(417) [52]=> int(302) [53]=> int(408) [54]=> int(208) [55]=> int(162) [56]=> int(182) [57]=> int(215) [58]=> int(219) [59]=> int(224) [60]=> int(259) [61]=> int(269) [62]=> int(458) [63]=> int(352) [64]=> int(237) [65]=> int(233) [66]=> int(242) [67]=> int(170) [68]=> int(293) [69]=> int(321) [70]=> int(341) [71]=> int(365) [72]=> int(351) [73]=> int(441) [74]=> int(428) [75]=> int(326) [76]=> int(376) [77]=> int(374) [78]=> int(273) [79]=> int(262) [80]=> int(181) [81]=> int(273) [82]=> int(280) [83]=> int(298) [84]=> int(268) [85]=> int(463) [86]=> int(380) [87]=> int(317) [88]=> int(321) [89]=> int(363) [90]=> int(533) [91]=> int(558) [92]=> int(588) [93]=> int(450) [94]=> int(438) [95]=> int(308) [96]=> int(398) [97]=> int(407) [98]=> int(338) [99]=> int(434) [100]=> int(388) [101]=> int(430) [102]=> int(392) [103]=> int(460) [104]=> int(444) [105]=> int(420) [106]=> int(495) [107]=> int(652) [108]=> int(551) [109]=> int(457) [110]=> int(463) [111]=> int(470) [112]=> int(460) [113]=> int(422) [114]=> int(463) [115]=> int(568) [116]=> int(617) [117]=> int(555) [118]=> int(474) [119]=> int(431) [120]=> int(443) [121]=> int(407) [122]=> int(379) [123]=> int(387) [124]=> int(435) [125]=> int(499) [126]=> int(464) [127]=> int(548) [128]=> int(456) [129]=> int(341) [130]=> int(453) [131]=> int(464) [132]=> int(598) [133]=> int(669) [134]=> int(349) [135]=> int(363) [136]=> int(422) [137]=> int(491) [138]=> int(634) [139]=> int(508) [140]=> int(238) [141]=> int(359) [142]=> int(355) [143]=> int(295) [144]=> int(325) [145]=> int(335) [146]=> int(491) [147]=> int(454) [148]=> int(299) [149]=> int(259) [150]=> int(435) [151]=> int(277) [152]=> int(475) [153]=> int(444) [154]=> int(294) [155]=> int(320) [156]=> int(290) [157]=> int(227) [158]=> int(256) [159]=> int(172) [160]=> int(219) [161]=> int(251) [162]=> int(340) [163]=> int(284) [164]=> int(236) [165]=> int(250) [166]=> int(297) [167]=> int(272) [168]=> int(822) [169]=> int(723) [170]=> int(455) [171]=> int(494) [172]=> int(268) [173]=> int(413) [174]=> int(297) [175]=> int(254) [176]=> int(398) [177]=> int(368) [178]=> int(244) [179]=> int(309) [180]=> int(269) [181]=> int(258) [182]=> int(445) [183]=> int(370) [184]=> int(493) [185]=> int(444) [186]=> int(309) [187]=> int(326) [188]=> int(319) [189]=> int(376) [190]=> int(374) [191]=> int(557) [192]=> int(418) [193]=> int(487) [194]=> int(474) [195]=> int(512) [196]=> int(500) [197]=> int(415) [198]=> int(483) [199]=> int(751) [200]=> int(999) [201]=> int(671) [202]=> int(531) [203]=> int(592) [204]=> int(618) [205]=> int(574) [206]=> int(620) [207]=> int(481) [208]=> int(419) [209]=> int(511) [210]=> int(547) [211]=> int(588) [212]=> int(937) [213]=> int(847) [214]=> int(679) [215]=> int(658) [216]=> int(793) [217]=> int(706) [218]=> int(553) [219]=> int(528) [220]=> int(356) [221]=> int(398) [222]=> int(320) [223]=> int(440) [224]=> int(429) [225]=> int(532) [226]=> int(314) [227]=> int(514) [228]=> int(509) [229]=> int(431) [230]=> int(512) [231]=> int(487) [232]=> int(441) [233]=> int(358) [234]=> int(278) [235]=> int(349) [236]=> int(370) [237]=> int(354) [238]=> int(358) [239]=> int(339) [240]=> int(414) [241]=> int(331) [242]=> int(380) [243]=> int(306) [244]=> int(441) [245]=> int(275) [246]=> int(345) [247]=> int(487) [248]=> int(243) [249]=> int(120) [250]=> int(137) [251]=> int(236) [252]=> int(184) [253]=> int(204) [254]=> int(246) [255]=> int(250) [256]=> int(263) [257]=> int(229) [258]=> int(327) [259]=> int(320) [260]=> int(425) [261]=> int(639) [262]=> int(563) [263]=> int(849) [264]=> int(472) [265]=> int(489) [266]=> int(484) [267]=> int(416) [268]=> int(536) [269]=> int(452) [270]=> int(308) [271]=> int(407) [272]=> int(405) [273]=> int(361) [274]=> int(417) [275]=> int(557) [276]=> int(378) [277]=> int(528) [278]=> int(496) [279]=> int(663) [280]=> int(557) [281]=> int(482) [282]=> int(265) [283]=> int(405) [284]=> int(443) [285]=> int(383) } }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/R6WIh 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/R6WIh 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/R6WIh 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/R6WIh on line 21