kphp icon indicating copy to clipboard operation
kphp copied to clipboard

Compilation error when using `nested list()`

Open Tsygankov-Slava opened this issue 1 year ago • 0 comments

Example code:

<?php
list($a, list($b, $c)) = array(1, array(2, 3));
var_dump($a, $b, $c);

Current output(Error):

Compilation error at stage: Gen tree postprocess, gen by gen-tree-postprocess.cpp:166
  index.php:3  in global scope
    list($a, list($b, $c)) = array(1, array(2, 3));

Unexpected list() not as left side of assignment

Expected output:

int(1)
int(2)
int(3)

Tsygankov-Slava avatar Aug 14 '23 18:08 Tsygankov-Slava