1 (edited by FancyPants31337 2020-02-26 11:31:43)

Topic: [php56] array_merge function broken

Hello, Guys!

We faced this issue after upgrade to latest 5.6.40 packages. and 5.6.36 works fine

Script:

===============
<?php
$a = [
    [1],[2]
];
print_r(array_merge(...$a));
===============


5.6.40:
PHP Warning:  array_merge() expects at least 1 parameter, 0 given in /tmp/test.php on line 5

5.6.36:
Array
(   
    [0] => 1
    [1] => 2
)

Is there any chance you fix it?

Thanks!

Re: [php56] array_merge function broken

Sorry, but I cannot reporoduce

$ php74 -r '$a=[[PHP_VERSION],[2]]; var_dump(array_merge(...$a));'
array(2) {
  [0]=>
  string(5) "7.4.3"
  [1]=>
  int(2)
}

$ php56 -r '$a=[[PHP_VERSION],[2]]; var_dump(array_merge(...$a));'
array(2) {
  [0]=>
  string(6) "5.6.40"
  [1]=>
  int(2)
}
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: [php56] array_merge function broken

Distro, version, arch, installed packages and enabled extensions may help

rpm -qa php\*
php --modules

Also:

php56    -r '$a=[[PHP_VERSION],[php_uname()]]; var_dump(array_merge(...$a));'
php56 -n -r '$a=[[PHP_VERSION],[php_uname()]]; var_dump(array_merge(...$a));'
Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: [php56] array_merge function broken

I also don't see any change between 5.6.36 and 5.6.40-18 (checked both Core and standard ext)
and all fixes are security related.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: [php56] array_merge function broken

Thanks for you reply, and help!
We managed to detect where the problem is - bad php module php-phalcon-1.3.4