File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array / array_flip.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:02 2012 UTC (12 years, 4 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
basic array_flip test
--FILE--
<?php
$trans = array("a" => 1, 
               "b" => 1, 
               "c" => 2, 
               "z" => 0, 
               "d" => TRUE, 
               "E" => FALSE, 
               "F" => NULL, 
               0 => "G", 
               1 => "h", 
               2 => "i");
$trans = array_flip($trans);
var_dump($trans);
?>
--EXPECTF--
Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d

Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d

Warning: array_flip(): Can only flip STRING and INTEGER values! in %s on line %d
array(6) {
  [1]=>
  string(1) "b"
  [2]=>
  string(1) "c"
  [0]=>
  string(1) "z"
  ["G"]=>
  int(0)
  ["h"]=>
  int(1)
  ["i"]=>
  int(2)
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>