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); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/kk0uZ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str, !1 = $polygon, !2 = $feature, !3 = $coordinates
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22type%22%3A%22FeatureCollection%22%2C%22features%22%3A%5B%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B9.78281%2C54.923985%5D%2C%5B9.80341%2C54.901586%5D%2C%5B9.819803%2C54.901981%5D%2C%5B9.83551%2C54.908396%5D%2C%5B9.825897%2C54.91481%5D%2C%5B9.822721%2C54.927142%5D%2C%5B9.807186%2C54.927931%5D%2C%5B9.792767%2C54.926797%5D%2C%5B9.78281%2C54.923985%5D%5D%5D%7D%7D%2C%7B%22type%22%3A%22Feature%22%2C%22properties%22%3A%7B%7D%2C%22geometry%22%3A%7B%22type%22%3A%22Polygon%22%2C%22coordinates%22%3A%5B%5B%5B9.914474%2C54.930298%5D%2C%5B9.901085%2C54.912343%5D%2C%5B9.849243%2C54.912146%5D%2C%5B9.846497%2C54.928917%5D%2C%5B9.890785%2C54.946865%5D%2C%5B9.930267%2C54.937399%5D%2C%5B9.914474%2C54.930298%5D%5D%5D%7D%7D%5D%7D'
    5     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        ASSIGN                                                   !1, $5
    7     5        FETCH_OBJ_R                                      ~7      !1, 'features'
          6      > FE_RESET_R                                       $8      ~7, ->18
          7    > > FE_FETCH_R                                               $8, !2, ->18
    8     8    >   FETCH_OBJ_R                                      ~9      !2, 'geometry'
          9        FETCH_OBJ_R                                      ~10     ~9, 'coordinates'
         10      > FE_RESET_R                                       $11     ~10, ->16
         11    > > FE_FETCH_R                                               $11, !3, ->16
   10    12    >   INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                                 
    8    15      > JMP                                                      ->11
         16    >   FE_FREE                                                  $11
    7    17      > JMP                                                      ->7
         18    >   FE_FREE                                                  $8
   13    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
240.74 ms | 1004 KiB | 15 Q