3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = '{ "plumber1": "-1.2523238641713191,36.87899683074249", "plumber2": "-1.2192245641713191,36.87899687428849", "allan plumber": "-1.2192238641713191,36.87899683068849" }'; $array =json_decode($str); $new_array = []; foreach ($array as $key => $value) { $coordinates = explode(',',$value); $coordinate1 = (float) $coordinates[0]; $coordinate2 = (float) $coordinates[1]; $new_array[] = array($key,$coordinate1,$coordinate2); } print_r($new_array); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 26
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/WiHbo
function name:  (null)
number of ops:  31
compiled vars:  !0 = $str, !1 = $array, !2 = $new_array, !3 = $value, !4 = $key, !5 = $coordinates, !6 = $coordinate1, !7 = $coordinate2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%7B%0A++++++%22plumber1%22%3A+%22-1.2523238641713191%2C36.87899683074249%22%2C%0A++++++%22plumber2%22%3A+%22-1.2192245641713191%2C36.87899687428849%22%2C%0A++++++%22allan+plumber%22%3A+%22-1.2192238641713191%2C36.87899683068849%22%0A++++%7D'
    8     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $9      
          4        ASSIGN                                                       !1, $9
    9     5        ASSIGN                                                       !2, <array>
   10     6      > FE_RESET_R                                           $12     !1, ->26
          7    > > FE_FETCH_R                                           ~13     $12, !3, ->26
          8    >   ASSIGN                                                       !4, ~13
   11     9        INIT_FCALL                                                   'explode'
         10        SEND_VAL                                                     '%2C'
         11        SEND_VAR                                                     !3
         12        DO_ICALL                                             $15     
         13        ASSIGN                                                       !5, $15
   12    14        FETCH_DIM_R                                          ~17     !5, 0
         15        CAST                                              5  ~18     ~17
         16        ASSIGN                                                       !6, ~18
   13    17        FETCH_DIM_R                                          ~20     !5, 1
         18        CAST                                              5  ~21     ~20
         19        ASSIGN                                                       !7, ~21
   14    20        INIT_ARRAY                                           ~24     !4
         21        ADD_ARRAY_ELEMENT                                    ~24     !6
         22        ADD_ARRAY_ELEMENT                                    ~24     !7
         23        ASSIGN_DIM                                                   !2
         24        OP_DATA                                                      ~24
   10    25      > JMP                                                          ->7
         26    >   FE_FREE                                                      $12
   16    27        INIT_FCALL                                                   'print_r'
         28        SEND_VAR                                                     !2
         29        DO_ICALL                                                     
   17    30      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
174.45 ms | 2356 KiB | 16 Q