3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = json_decode('[{"uid":"352","pcode1":"AB1","pname":"XXAB1"},{"uid":"352","pcode1":"AB1","pname":"XAB1"}]',true); foreach ($json as $key => &$value) { if(strpos($value['pname'], 'XX') === 0) { unset($value['pname']); } } $j = json_encode($json); echo $j; print_r($json);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 6, Position 2 = 17
Branch analysis from position: 6
2 jumps found. (Code = 126) Position 1 = 7, Position 2 = 17
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/YRIpS
function name:  (null)
number of ops:  27
compiled vars:  !0 = $json, !1 = $value, !2 = $key, !3 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%5B%7B%22uid%22%3A%22352%22%2C%22pcode1%22%3A%22AB1%22%2C%22pname%22%3A%22XXAB1%22%7D%2C%7B%22uid%22%3A%22352%22%2C%22pcode1%22%3A%22AB1%22%2C%22pname%22%3A%22XAB1%22%7D%5D'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
    5     5      > FE_RESET_RW                                      $6      !0, ->17
          6    > > FE_FETCH_RW                                      ~7      $6, !1, ->17
          7    >   ASSIGN                                                   !2, ~7
    6     8        INIT_FCALL                                               'strpos'
          9        FETCH_DIM_R                                      ~9      !1, 'pname'
         10        SEND_VAL                                                 ~9
         11        SEND_VAL                                                 'XX'
         12        DO_ICALL                                         $10     
         13        IS_IDENTICAL                                             $10, 0
         14      > JMPZ                                                     ~11, ->16
    7    15    >   UNSET_DIM                                                !1, 'pname'
    5    16    > > JMP                                                      ->6
         17    >   FE_FREE                                                  $6
   11    18        INIT_FCALL                                               'json_encode'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $12     
         21        ASSIGN                                                   !3, $12
   12    22        ECHO                                                     !3
   14    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.43 ms | 1396 KiB | 21 Q