File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / mbstring / tests / bug40685.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:40 2012 UTC (12 years, 1 month 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, HEAD
php 5.4.3+patches

--TEST--
Bug #40685 (mb_decode_numericentity() removes '&' in the string)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
$map = array(0, 0x10FFFF, 0, 0xFFFFFF);
var_dump(mb_decode_numericentity('&', $map, 'UTF-8'));
var_dump(mb_decode_numericentity('&&&', $map, 'UTF-8'));
var_dump(mb_decode_numericentity('&#', $map, 'UTF-8'));
var_dump(mb_decode_numericentity('&#x', $map, 'UTF-8'));
var_dump(mb_decode_numericentity('&#61', $map, 'UTF-8'));
var_dump(mb_decode_numericentity('&#x3d', $map, 'UTF-8'));
var_dump(mb_decode_numericentity('&#61;', $map, 'UTF-8'));
var_dump(mb_decode_numericentity('&#x3d;', $map, 'UTF-8'));
?>
--EXPECTF--
string(1) "&"
string(3) "&&&"
string(2) "&#"
string(3) "&#x"
string(4) "&#61"
string(5) "&#x3D"
string(1) "="
string(1) "="

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