3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source_arr = ["Car" => "Volvo", "City" => "Stockholm", "Country" => "Sweden"]; $new_arr = []; array_push( $new_arr, ...key_exists("Car", $source_arr) ? [$source_arr["Car"]] : [], ...key_exists("State", $source_arr) ? [$source_arr["State"]] : [] ); var_export($new_arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
Branch analysis from position: 24
filename:       /in/JRRmR
function name:  (null)
number of ops:  32
compiled vars:  !0 = $source_arr, !1 = $new_arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'array_push'
    7     3        SEND_REF                                                 !1
    8     4        INIT_FCALL                                               'key_exists'
          5        SEND_VAL                                                 'Car'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->13
          9    >   FETCH_DIM_R                                      ~5      !0, 'Car'
         10        INIT_ARRAY                                       ~6      ~5
         11        QM_ASSIGN                                        ~7      ~6
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~7      <array>
         14    >   SEND_UNPACK                                              ~7
    9    15        INIT_FCALL                                               'key_exists'
         16        SEND_VAL                                                 'State'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $8      
         19      > JMPZ                                                     $8, ->24
         20    >   FETCH_DIM_R                                      ~9      !0, 'State'
         21        INIT_ARRAY                                       ~10     ~9
         22        QM_ASSIGN                                        ~11     ~10
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~11     <array>
         25    >   SEND_UNPACK                                              ~11
         26        CHECK_UNDEF_ARGS                                         
    6    27        DO_ICALL                                                 
   12    28        INIT_FCALL                                               'var_export'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.23 ms | 1013 KiB | 16 Q