php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67813 CachingIterator::__construct InvalidArgumentException wrong message
Submitted: 2014-08-09 14:31 UTC Modified: -
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tim_siebels_aurich at yahoo dot de Assigned:
Status: Closed Package: SPL related
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
 [2014-08-09 14:31 UTC] tim_siebels_aurich at yahoo dot de
Description:
------------
Creating a `new CachingIterator` with invalid flags throws an `InvalidArgumentException`. The message however is wrong and does not match `setFlags`. It says `TOSTRING_USE_CURRENT` twice.

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

try {
  new CachingIterator(new ArrayIterator([]), 3);
} catch (Exception $e) {
  echo $e->getMessage();
}

Expected result:
----------------
Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_INNER

Actual result:
--------------
Flags must contain only one of CALL_TOSTRING, TOSTRING_USE_KEY, TOSTRING_USE_CURRENT, TOSTRING_USE_CURRENT

Patches

fix-exceptionmsg-cachingitctor (last revision 2014-08-09 14:34 UTC by tim_siebels_aurich at yahoo dot de)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-11 09:51 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b6ddcf9c7176f6cca06804c747c08bee89980e44
Log: Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message)
 [2014-08-11 09:51 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2014-08-11 09:51 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b6ddcf9c7176f6cca06804c747c08bee89980e44
Log: Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message)
 [2014-08-11 09:51 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b6ddcf9c7176f6cca06804c747c08bee89980e44
Log: Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message)
 [2014-08-12 10:47 UTC] dmitry@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b6ddcf9c7176f6cca06804c747c08bee89980e44
Log: Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message)
 [2014-08-14 00:52 UTC] tyrael@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b6ddcf9c7176f6cca06804c747c08bee89980e44
Log: Fixed bug #67813 (CachingIterator::__construct InvalidArgumentException wrong message)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 13:01:27 2024 UTC