php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71751 Return incorrect result
Submitted: 2016-03-09 07:42 UTC Modified: 2016-03-09 08:01 UTC
From: sasha87654321 at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: Irrelevant OS: Linux ehml2.ix-host.ru 2.6.32-57
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sasha87654321 at gmail dot com
New email:
PHP Version: OS:

 

 [2016-03-09 07:42 UTC] sasha87654321 at gmail dot com
Description:
------------
I found an error in the function array_diff.
Test it on:

- PHP Version 7.0.3 (System - Linux ehml2.ix-host.ru 2.6.32-573.8.1.el6.x86_64)
- PHP Version 5.4.38 (System - Linux ehml2.ix-host.ru 2.6.32-573.8.1.el6.x86_64)
- PHP Version 5.4.45 (Linux mocha3015.mochahost.com 2.6.32-531.29.2.lve1.3.11.1.el6.x86_64)

Result of array_diff return few empty values.

See -  http://pro-photos.net/write/php_bug.php


Test script:
---------------
Bug info page - http://pro-photos.net/write/php_bug.php#tscript

Expected result:
----------------
See - http://photos.net/write/php_bug.php#myscr

Actual result:
--------------
See - http://pro-photos.net/write/php_bug.php#tsr

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-09 08:01 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2016-03-09 08:01 UTC] requinix@php.net
array_diff() preserves keys.
 [2016-03-09 08:56 UTC] sasha87654321 at gmail dot com
No.
Problem is not in the preservation of keys. For example,
$myarr has '40989767' value (last one) and $myarr_del hasn't.
array_diff() must return this value in result, but don't.
 [2016-03-09 09:05 UTC] sasha87654321 at gmail dot com
Sorry, I found my mistake.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 17:01:29 2024 UTC