3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "metingen": [ { "label": "06-06-2019 13:13:38", "value": 25.21 }, { "label": "06-06-2019 13:51:04", "value": 27.69 }, { "label": "06-06-2019 13:52:04", "value": 27.69 }, { "label": "06-06-2019 13:53:06", "value": 27.61 }]}'; $jToArr = json_decode($json, true); $res = []; foreach($jToArr['metingen'] as $key => $value){ $res[] = ['x' => $value['label'], 'y' => $value['value']]; } print_r($res);
Output for 7.1.25 - 7.1.30, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
Array ( [0] => Array ( [x] => 06-06-2019 13:13:38 [y] => 25.21 ) [1] => Array ( [x] => 06-06-2019 13:51:04 [y] => 27.69 ) [2] => Array ( [x] => 06-06-2019 13:52:04 [y] => 27.69 ) [3] => Array ( [x] => 06-06-2019 13:53:06 [y] => 27.61 ) )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
192.6 ms | 407 KiB | 5 Q