php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71837 Wrong arrays behaviour
Submitted: 2016-03-16 14:25 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: young dot inbox at gmail dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 7.0.4 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
26 + 50 = ?
Subscribe to this entry?

 
 [2016-03-16 14:25 UTC] young dot inbox at gmail dot com
Description:
------------
Value 200 shouldn't appear on array $p

And it gives different results on php5/7

Test script:
---------------
<?php

$p = array(array());
array_push($p[0], array(100));

$c = array_merge($p, array());
$c[0][0] = 200;

print_r($p);


Expected result:
----------------
Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [0] => 100
                )

        )

)


Actual result:
--------------
Array
(
    [0] => Array
        (
            [0] => 200
        )

)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-17 14:51 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=345ecd9822820a54134bd53a6e449e1f22612e19
Log: Fixed #71837 (Wrong arrays behaviour)
 [2016-03-17 14:51 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-07-20 11:32 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=345ecd9822820a54134bd53a6e449e1f22612e19
Log: Fixed #71837 (Wrong arrays behaviour)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC