3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '{"count":22,"property":[{"name":"ArtifactsSize","value":"30537"},{"name":"BuildArtifactsPublishingTime","value":"327"},{"name":"BuildCheckoutTime","value":"389"},{"name":"BuildDuration","value":"9333"},{"name":"BuildDurationNetTime","value":"8617"},{"name":"buildStageDuration:artifactsPublishing","value":"766"},{"name":"buildStageDuration:buildFinishing","value":"513"},{"name":"buildStageDuration:buildStepRUNNER_66","value":"7475"},{"name":"buildStageDuration:firstStepPreparation","value":"63"},{"name":"buildStageDuration:sourcesUpdate","value":"397"},{"name":"BuildTestStatus","value":"1"},{"name":"CodeCoverageAbsLCovered","value":"105"},{"name":"CodeCoverageAbsLTotal","value":"1017"},{"name":"CodeCoverageAbsMCovered","value":"32"},{"name":"CodeCoverageAbsMTotal","value":"341"},{"name":"CodeCoverageB","value":"10.32"},{"name":"CodeCoverageL","value":"10.3244838714599609375"},{"name":"CodeCoverageM","value":"9.38416385650634765625"},{"name":"PassedTestCount","value":"22"},{"name":"SuccessRate","value":"1"},{"name":"TimeSpentInQueue","value":"335"},{"name":"TotalTestCount","value":"22"}]}'; $statistics = json_decode($string); $stats = array(); if (isset($statistics->property)) { foreach ($statistics->property as $property) { $stats[$property['name']] = $property['value']; } } var_dump($stats);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/HbSHH:9 Stack trace: #0 {main} thrown in /in/HbSHH on line 9
Process exited with code 255.
Output for 5.3.21 - 5.6.21
Fatal error: Cannot use object of type stdClass as array in /in/HbSHH on line 9
Process exited with code 255.