3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = '{"data":"key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47"}'; $array = json_decode($data, true); $strArray = explode(',', $array['data']); $clean = []; while(count($strArray) >= 2){ $key = explode('=', array_shift($strArray))[1]; $age = explode('=', array_shift($strArray))[1]; $clean[$key] = (int)$age; } var_dump($clean);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 14
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 14
Branch analysis from position: 38
Branch analysis from position: 14
filename:       /in/RIF2q
function name:  (null)
number of ops:  42
compiled vars:  !0 = $data, !1 = $array, !2 = $strArray, !3 = $clean, !4 = $key, !5 = $age
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%7B%22data%22%3A%22key%3DIAfpK%2C+age%3D58%2C+key%3DWNVdi%2C+age%3D64%2C+key%3Djp9zt%2C+age%3D47%22%7D'
    4     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $7      
          5        ASSIGN                                                       !1, $7
    5     6        INIT_FCALL                                                   'explode'
          7        SEND_VAL                                                     '%2C'
          8        FETCH_DIM_R                                          ~9      !1, 'data'
          9        SEND_VAL                                                     ~9
         10        DO_ICALL                                             $10     
         11        ASSIGN                                                       !2, $10
    7    12        ASSIGN                                                       !3, <array>
    8    13      > JMP                                                          ->35
    9    14    >   INIT_FCALL                                                   'explode'
         15        SEND_VAL                                                     '%3D'
         16        INIT_FCALL                                                   'array_shift'
         17        SEND_REF                                                     !2
         18        DO_ICALL                                             $13     
         19        SEND_VAR                                                     $13
         20        DO_ICALL                                             $14     
         21        FETCH_DIM_R                                          ~15     $14, 1
         22        ASSIGN                                                       !4, ~15
   10    23        INIT_FCALL                                                   'explode'
         24        SEND_VAL                                                     '%3D'
         25        INIT_FCALL                                                   'array_shift'
         26        SEND_REF                                                     !2
         27        DO_ICALL                                             $17     
         28        SEND_VAR                                                     $17
         29        DO_ICALL                                             $18     
         30        FETCH_DIM_R                                          ~19     $18, 1
         31        ASSIGN                                                       !5, ~19
   11    32        CAST                                              4  ~22     !5
         33        ASSIGN_DIM                                                   !3, !4
         34        OP_DATA                                                      ~22
    8    35    >   COUNT                                                ~23     !2
         36        IS_SMALLER_OR_EQUAL                                          2, ~23
         37      > JMPNZ                                                        ~24, ->14
   14    38    >   INIT_FCALL                                                   'var_dump'
         39        SEND_VAR                                                     !3
         40        DO_ICALL                                                     
         41      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
145.6 ms | 1771 KiB | 17 Q