kphp icon indicating copy to clipboard operation
kphp copied to clipboard

Compile error when using `array_merge_into` and array without specified type

Open Danil42Russia opened this issue 2 years ago • 0 comments

Example code:

<?php

function main()
{
    $arr_one = [];
    $arr_two = [];

    if (1) {
        $arr_one = [1, 2, 3];
    }

    $result = [];
    array_merge_into($result, $arr_one);
    array_merge_into($result, $arr_two);

    var_dump($result);
}

main();

Problem c++ code:

  array< int64_t > v$arr_one;
  array< Unknown > v$arr_two;
  array< int64_t > v$result;

Danil42Russia avatar May 06 '23 20:05 Danil42Russia