3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results_decoded = array ( 0 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211049', ), ), ), 1 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211048', ), ), ), 2 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211050', ), ), ), 3 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211050', ), ), ), 4 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211049', ), ), ), 5 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211046', ), ), ), 6 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211045', ), ), ), 7 => array ( 'result' => '2007: New Web Order created successfully', ), 8 => array ( 'Result' => array ( 0 => array ( 'ERRORS' => '99012: Weborder number already exists : 20211046', ), ), )); foreach ($results_decoded as $inner_val){ $result_array[] = $inner_val["Result"][0]["ERRORS"] ?? $inner_val['result'] ?? ''; } $result_array = array_values($result_array); echo json_encode($result_array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 14
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/nRCQS
function name:  (null)
number of ops:  24
compiled vars:  !0 = $results_decoded, !1 = $inner_val, !2 = $result_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1      > FE_RESET_R                                       $4      !0, ->14
          2    > > FE_FETCH_R                                               $4, !1, ->14
   15     3    >   FETCH_DIM_IS                                     ~6      !1, 'Result'
          4        FETCH_DIM_IS                                     ~7      ~6, 0
          5        FETCH_DIM_IS                                     ~8      ~7, 'ERRORS'
          6        COALESCE                                         ~9      ~8
          7        FETCH_DIM_IS                                     ~10     !1, 'result'
          8        COALESCE                                         ~11     ~10
          9        QM_ASSIGN                                        ~11     ''
         10        QM_ASSIGN                                        ~9      ~11
         11        ASSIGN_DIM                                               !2
         12        OP_DATA                                                  ~9
   14    13      > JMP                                                      ->2
         14    >   FE_FREE                                                  $4
   18    15        INIT_FCALL                                               'array_values'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !2, $12
   20    19        INIT_FCALL                                               'json_encode'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                         $14     
         22        ECHO                                                     $14
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.75 ms | 1006 KiB | 15 Q