php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63315 BitSet::fromArray modifies original array value if a non-integer is supplied
Submitted: 2012-10-19 18:21 UTC Modified: 2017-10-24 03:26 UTC
From: willfitch@php.net Assigned: willfitch (profile)
Status: Assigned Package: Bitset (PECL)
PHP Version: Irrelevant OS: Linux
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: willfitch@php.net
New email:
PHP Version: OS:

 

 [2012-10-19 18:21 UTC] willfitch@php.net
Description:
------------
When passing an array to BitSet::fromArray, the original array is modified when 
any of the values in the array are non-long.

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

$arr = array(5, 6, '7');
var_dump($arr);
BitSet::fromArray($arr);
var_dump($arr);

?>

Expected result:
----------------
array(3) {
  [0]=>
  int(5)
  [1]=>
  int(6)
  [2]=>
  string(1) "7"
}

Actual result:
--------------
array(3) {
  [0]=>
  int(5)
  [1]=>
  int(6)
  [2]=>
  int(7)
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-19 18:21 UTC] willfitch@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: willfitch
 [2017-10-24 03:26 UTC] kalle@php.net
-Status: Verified +Status: Assigned
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC