3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = '{ "servers": [ { "id": "f34c0185-4c9e-40fd-82f6-1d6e9a5d499e", "name": "vm01" }, { "id": "d671ac7d-3b5a-4777-8510-6e8e58295061", "name": "vm02" }, { "id": "h59j23cc-9ve2-4508-1277-85y1lo27562m", "name": "vm03" } ] }'; $j = json_decode($json, true); foreach($j['servers'] as $arr) { if( $arr['id'] == 'd671ac7d-3b5a-4777-8510-6e8e58295061' ) echo $arr['name']; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) 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/0DboX
function name:  (null)
number of ops:  17
compiled vars:  !0 = $json, !1 = $j, !2 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%7B%0A++++%22servers%22%3A+%5B%0A++++++++%7B%0A++++++++++++%22id%22%3A+%22f34c0185-4c9e-40fd-82f6-1d6e9a5d499e%22%2C%0A++++++++++++%22name%22%3A+%22vm01%22%0A++++++++%7D%2C%0A++++++++%7B%0A++++++++++++%22id%22%3A+%22d671ac7d-3b5a-4777-8510-6e8e58295061%22%2C%0A++++++++++++%22name%22%3A+%22vm02%22%0A++++++++%7D%2C%0A++++++++%7B%0A++++++++++++%22id%22%3A+%22h59j23cc-9ve2-4508-1277-85y1lo27562m%22%2C%0A++++++++++++%22name%22%3A+%22vm03%22%0A++++++++%7D%0A++++%5D%0A%7D'
   19     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !1, $4
   21     6        FETCH_DIM_R                                          ~6      !1, 'servers'
          7      > FE_RESET_R                                           $7      ~6, ->15
          8    > > FE_FETCH_R                                                   $7, !2, ->15
   23     9    >   FETCH_DIM_R                                          ~8      !2, 'id'
         10        IS_EQUAL                                                     ~8, 'd671ac7d-3b5a-4777-8510-6e8e58295061'
         11      > JMPZ                                                         ~9, ->14
         12    >   FETCH_DIM_R                                          ~10     !2, 'name'
         13        ECHO                                                         ~10
   21    14    > > JMP                                                          ->8
         15    >   FE_FREE                                                      $7
   24    16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
150.11 ms | 1878 KiB | 14 Q