3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 0 => '"["Option 1", "Option 2", "Option 3"]"', 1 => '"["Option 1.1", "Option 1.2"]"' ]; foreach($arr as &$a) $a = json_decode(trim($a, '"'), true); var_dump($arr); var_dump([0=>array_merge(... $arr)]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/VrfIY
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    7     1      > FE_RESET_RW                                      $3      !0, ->13
          2    > > FE_FETCH_RW                                              $3, !1, ->13
          3    >   INIT_FCALL                                               'json_decode'
          4        INIT_FCALL                                               'trim'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 '%22'
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
         12      > JMP                                                      ->2
         13    >   FE_FREE                                                  $3
    8    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
    9    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'array_merge'
         19        SEND_UNPACK                                              !0
         20        CHECK_UNDEF_ARGS                                         
         21        DO_ICALL                                         $8      
         22        INIT_ARRAY                                       ~9      $8, 0
         23        SEND_VAL                                                 ~9
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.36 ms | 1395 KiB | 21 Q