3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = array(); //$json = file_get_contents ('php://input'); $json = '[{"friends_with_accepted":"false","friends_with_synced":"false","friends_with_second_id":"5","friends_with_first_id":"6"}]'; $jsonArray = json_decode ($json, true); foreach ($jsonArray as $jsonObject) { $firstId = $jsonObject['friends_with_first_id']; $accepted = $jsonObject ['friends_with_accepted']; $secondId = $jsonObject ['friends_with_second_id']; $synced = $jsonObject ['friends_with_synced']; echo "accepted: ".$accepted."synced: ".$synced; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/dY9vR
function name:  (null)
number of ops:  24
compiled vars:  !0 = $response, !1 = $json, !2 = $jsonArray, !3 = $jsonObject, !4 = $firstId, !5 = $accepted, !6 = $secondId, !7 = $synced
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, '%5B%7B%22friends_with_accepted%22%3A%22false%22%2C%22friends_with_synced%22%3A%22false%22%2C%22friends_with_second_id%22%3A%225%22%2C%22friends_with_first_id%22%3A%226%22%7D%5D'
    7     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $10     
          6        ASSIGN                                                   !2, $10
    8     7      > FE_RESET_R                                       $12     !2, ->22
          8    > > FE_FETCH_R                                               $12, !3, ->22
    9     9    >   FETCH_DIM_R                                      ~13     !3, 'friends_with_first_id'
         10        ASSIGN                                                   !4, ~13
   10    11        FETCH_DIM_R                                      ~15     !3, 'friends_with_accepted'
         12        ASSIGN                                                   !5, ~15
   11    13        FETCH_DIM_R                                      ~17     !3, 'friends_with_second_id'
         14        ASSIGN                                                   !6, ~17
   12    15        FETCH_DIM_R                                      ~19     !3, 'friends_with_synced'
         16        ASSIGN                                                   !7, ~19
   14    17        CONCAT                                           ~21     'accepted%3A+', !5
         18        CONCAT                                           ~22     ~21, 'synced%3A+'
         19        CONCAT                                           ~23     ~22, !7
         20        ECHO                                                     ~23
    8    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $12
   15    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.77 ms | 1396 KiB | 15 Q