3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = ' [ { "ID":"109", "PROPERTY_70":{ "194":"Текст 1" } }, { "ID":"110", "PROPERTY_70":{ "118":"Текст 2" } } ]'; foreach (json_decode($json, true) as $item) { // 1 echo array_values($item['PROPERTY_70'])[0] . PHP_EOL; // 2 echo end($item['PROPERTY_70']) . PHP_EOL; // 3 echo array_shift($item['PROPERTY_70']) . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 27
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/Rt2JU
function name:  (null)
number of ops:  29
compiled vars:  !0 = $json, !1 = $item
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%0A%5B%0A+++%7B%0A++++++%22ID%22%3A%22109%22%2C%0A++++++%22PROPERTY_70%22%3A%7B%0A+++++++++%22194%22%3A%22%D0%A2%D0%B5%D0%BA%D1%81%D1%82+1%22%0A++++++%7D%0A+++%7D%2C%0A+++%7B%0A++++++%22ID%22%3A%22110%22%2C%0A++++++%22PROPERTY_70%22%3A%7B%0A+++++++++%22118%22%3A%22%D0%A2%D0%B5%D0%BA%D1%81%D1%82+2%22%0A++++++%7D%0A+++%7D%0A%5D'
   19     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     <true>
          4        DO_ICALL                                             $3      
          5      > FE_RESET_R                                           $4      $3, ->27
          6    > > FE_FETCH_R                                                   $4, !1, ->27
   21     7    >   INIT_FCALL                                                   'array_values'
          8        FETCH_DIM_R                                          ~5      !1, 'PROPERTY_70'
          9        SEND_VAL                                                     ~5
         10        DO_ICALL                                             $6      
         11        FETCH_DIM_R                                          ~7      $6, 0
         12        CONCAT                                               ~8      ~7, '%0A'
         13        ECHO                                                         ~8
   24    14        INIT_FCALL                                                   'end'
         15        FETCH_DIM_W                                          $9      !1, 'PROPERTY_70'
         16        SEND_REF                                                     $9
         17        DO_ICALL                                             $10     
         18        CONCAT                                               ~11     $10, '%0A'
         19        ECHO                                                         ~11
   27    20        INIT_FCALL                                                   'array_shift'
         21        FETCH_DIM_W                                          $12     !1, 'PROPERTY_70'
         22        SEND_REF                                                     $12
         23        DO_ICALL                                             $13     
         24        CONCAT                                               ~14     $13, '%0A'
         25        ECHO                                                         ~14
   19    26      > JMP                                                          ->6
         27    >   FE_FREE                                                      $4
   28    28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.77 ms | 2176 KiB | 17 Q