3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"language":"en","education":[{"unit":"e1","language":"en"}],"membership":[{"uei":"21","Uifed":"failed"}]}'; $arrayData = json_decode($json, true); foreach ($arrayData['membership'] as &$membership) { if ('failed' === $membership['Uifed']) { $membership['Uifed'] = 'success'; } } print_r($arrayData);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/QluPF
function name:  (null)
number of ops:  20
compiled vars:  !0 = $json, !1 = $arrayData, !2 = $membership
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22language%22%3A%22en%22%2C%22education%22%3A%5B%7B%22unit%22%3A%22e1%22%2C%22language%22%3A%22en%22%7D%5D%2C%22membership%22%3A%5B%7B%22uei%22%3A%2221%22%2C%22Uifed%22%3A%22failed%22%7D%5D%7D'
    4     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    5     6        FETCH_DIM_W                                      $6      !1, 'membership'
          7      > FE_RESET_RW                                      $7      $6, ->15
          8    > > FE_FETCH_RW                                              $7, !2, ->15
    6     9    >   FETCH_DIM_R                                      ~8      !2, 'Uifed'
         10        IS_IDENTICAL                                             ~8, 'failed'
         11      > JMPZ                                                     ~9, ->14
    7    12    >   ASSIGN_DIM                                               !2, 'Uifed'
         13        OP_DATA                                                  'success'
    5    14    > > JMP                                                      ->8
         15    >   FE_FREE                                                  $7
   10    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.93 ms | 953 KiB | 15 Q