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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: young dot inbox at gmail dot com
New email:
PHP Version: OS:

 

 [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 Apr 19 18:01:28 2024 UTC