3v4l.org

run code in 300+ PHP versions simultaneously
<?php $details='[{"percentage":"12.5","id":10},{"percentage":"35","id":12},{"percentage":"5","id":52}]'; $data=(json_decode($details)); foreach($data as $d){ if($d['id'] == 52){ print_r($d['percentage']); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
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/9vmhT
function name:  (null)
number of ops:  17
compiled vars:  !0 = $details, !1 = $data, !2 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5B%7B%22percentage%22%3A%2212.5%22%2C%22id%22%3A10%7D%2C%7B%22percentage%22%3A%2235%22%2C%22id%22%3A12%7D%2C%7B%22percentage%22%3A%225%22%2C%22id%22%3A52%7D%5D'
    4     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    6     5      > FE_RESET_R                                       $6      !1, ->15
          6    > > FE_FETCH_R                                               $6, !2, ->15
    7     7    >   FETCH_DIM_R                                      ~7      !2, 'id'
          8        IS_EQUAL                                                 ~7, 52
          9      > JMPZ                                                     ~8, ->14
    8    10    >   INIT_FCALL                                               'print_r'
         11        FETCH_DIM_R                                      ~9      !2, 'percentage'
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
    6    14    > > JMP                                                      ->6
         15    >   FE_FREE                                                  $6
   10    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.29 ms | 965 KiB | 15 Q