xref: /php-src/ext/spl/tests/bug40872.phpt (revision f8d79582)
1--TEST--
2Bug #40872 (inconsistency in offsetSet, offsetExists treatment of string enclosed integers)
3--FILE--
4<?php
5    class Project {
6        public $id;
7
8        function __construct($id) {
9            $this->id = $id;
10        }
11    }
12
13    class ProjectsList extends ArrayIterator {
14        public function add(Project $item) {
15            $this->offsetSet($item->id, $item);
16        }
17    }
18
19    $projects = new ProjectsList();
20    $projects->add(new Project('1'));
21    $projects->add(new Project(2));
22
23    var_dump($projects->offsetExists(1));
24    var_dump($projects->offsetExists('2'));
25?>
26--EXPECT--
27bool(true)
28bool(true)
29