3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<JSON [ [ 51.11041991029261, -2.274169921875 ], [ 51.08282186160978, -3.460693359375 ], [ 50.443513052458044, -3.570556640625 ], [ 50.443513052458044, -1.966552734375 ] ] JSON; $coords = json_decode($json, true); $lats = array_map(function (array $coord) { return $coord[0]; }, $coords); $lons = array_map(function (array $coord) { return $coord[1]; }, $coords); var_dump($lats, $lons);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mAMiB
function name:  (null)
number of ops:  23
compiled vars:  !0 = $json, !1 = $coords, !2 = $lats, !3 = $lons
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5B+%5B+51.11041991029261%2C+-2.274169921875+%5D%2C+%5B+51.08282186160978%2C+-3.460693359375+%5D%2C+%5B+50.443513052458044%2C+-3.570556640625+%5D%2C+%5B+50.443513052458044%2C+-1.966552734375+%5D+%5D'
    7     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    8     6        INIT_FCALL                                               'array_map'
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmAMiB%3A8%240'
          8        SEND_VAL                                                 ~7
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
    9    12        INIT_FCALL                                               'array_map'
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmAMiB%3A9%241'
         14        SEND_VAL                                                 ~10
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !3, $11
   12    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !2
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FmAMiB%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mAMiB
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $coord
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmAMiB%3A8%240

Function %00%7Bclosure%7D%2Fin%2FmAMiB%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mAMiB
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $coord
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        FETCH_DIM_R                                      ~1      !0, 1
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmAMiB%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.98 ms | 1400 KiB | 19 Q