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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 22:00:01 2026 UTC