xref: /PHP-7.4/tests/lang/bug24652.phpt (revision 610c7fbe)
1--TEST--
2Bug #24652 (broken array_flip())
3--FILE--
4<?php
5  /* This works */
6  $f = array('7' => 0);
7  var_dump($f);
8  var_dump(array_key_exists(7, $f));
9  var_dump(array_key_exists('7', $f));
10
11  print "----------\n";
12  /* This doesn't */
13  $f = array_flip(array('7'));
14  var_dump($f);
15  var_dump(array_key_exists(7, $f));
16  var_dump(array_key_exists('7', $f));
17?>
18--EXPECT--
19array(1) {
20  [7]=>
21  int(0)
22}
23bool(true)
24bool(true)
25----------
26array(1) {
27  [7]=>
28  int(0)
29}
30bool(true)
31bool(true)
32