3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[9.78281,54.923985],[9.80341,54.901586],[9.819803,54.901981],[9.83551,54.908396],[9.825897,54.91481],[9.822721,54.927142],[9.807186,54.927931],[9.792767,54.926797],[9.78281,54.923985]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[9.914474,54.930298],[9.901085,54.912343],[9.849243,54.912146],[9.846497,54.928917],[9.890785,54.946865],[9.930267,54.937399],[9.914474,54.930298]]]}}]}'; $polygon = json_decode($str); foreach($polygon->features as $feature){ foreach($feature->geometry->coordinates as $coordinates) { print_r($coordinates); } }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 9.78281 [1] => 54.923985 ) [1] => Array ( [0] => 9.80341 [1] => 54.901586 ) [2] => Array ( [0] => 9.819803 [1] => 54.901981 ) [3] => Array ( [0] => 9.83551 [1] => 54.908396 ) [4] => Array ( [0] => 9.825897 [1] => 54.91481 ) [5] => Array ( [0] => 9.822721 [1] => 54.927142 ) [6] => Array ( [0] => 9.807186 [1] => 54.927931 ) [7] => Array ( [0] => 9.792767 [1] => 54.926797 ) [8] => Array ( [0] => 9.78281 [1] => 54.923985 ) ) Array ( [0] => Array ( [0] => 9.914474 [1] => 54.930298 ) [1] => Array ( [0] => 9.901085 [1] => 54.912343 ) [2] => Array ( [0] => 9.849243 [1] => 54.912146 ) [3] => Array ( [0] => 9.846497 [1] => 54.928917 ) [4] => Array ( [0] => 9.890785 [1] => 54.946865 ) [5] => Array ( [0] => 9.930267 [1] => 54.937399 ) [6] => Array ( [0] => 9.914474 [1] => 54.930298 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.33 ms | 411 KiB | 5 Q