3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response_return = ''; $response = '{"status":"failure","reason":{"base":["Reached campaign cap"]},"testing":false}'; // Provide $data = json_decode($response, true); if ($data['status'] != 'failure') { $response_return = 'Success'; } else { $response_return = $data['reason']['base']; } var_dump($response_return);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0pnaQ
function name:  (null)
number of ops:  19
compiled vars:  !0 = $response_return, !1 = $response, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, ''
    5     1        ASSIGN                                                   !1, '%7B%22status%22%3A%22failure%22%2C%22reason%22%3A%7B%22base%22%3A%5B%22Reached+campaign+cap%22%5D%7D%2C%22testing%22%3Afalse%7D'
    8     2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    9     7        FETCH_DIM_R                                      ~7      !2, 'status'
          8        IS_NOT_EQUAL                                             ~7, 'failure'
          9      > JMPZ                                                     ~8, ->12
   10    10    >   ASSIGN                                                   !0, 'Success'
         11      > JMP                                                      ->15
   12    12    >   FETCH_DIM_R                                      ~10     !2, 'reason'
         13        FETCH_DIM_R                                      ~11     ~10, 'base'
         14        ASSIGN                                                   !0, ~11
   17    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.58 ms | 1395 KiB | 17 Q