From:             webdevguy1 at yahoo dot com
Operating system: Win2k
PHP version:      4.3.9RC1
PHP Bug Type:     Strings related
Bug description:  Incorrect string handling of "<" and "&"

Description:
------------
Improper string handling of "<" and "&" characters.

Refer to test code below.

Reproduce code:
---------------
$test1a='/(?<!\\)/';
echo $test1a;

$test1b='/(?<!\\)/';
echo $test1b;
var_dump($test1b);

$test1c='/(?<!\\)/';
var_dump($test1c);

$test2a='<';
echo $test2a;

$test2b='<<br />';
echo $test2b;

$test2c='<';
var_dump($test2c);

$test2f='<';
echo $test2f;
var_dump($test2f);

$test3f='&';
echo $test3f;
var_dump($test3f);

Expected result:
----------------
test1a: /(?<!\\)/

test1b: /(?<!\\)/

test1c: string(9) "/(?<!\\)/"

test2a: <

test2b: <

test2c: string(1) "<"

test2f: <string(1) "<"

tests 3a-3e: replace "<" with "&": same results

test3f: &string(1) "&"

Actual result:
--------------
test1a outputs: /(?

test1b outputs: /(?

test1c outputs: string(8) "/(?

test2a outputs:

test2b outputs: <

test2c outputs: string(1) "<"

test2f outputs: <"

tests 3a-3e: replace "<" with "&": same results

test3f outputs: &string(1) "&"

-- 
Edit bug report at http://bugs.php.net/?id=29642&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29642&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29642&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29642&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29642&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29642&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29642&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29642&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29642&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29642&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29642&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29642&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29642&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29642&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29642&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29642&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29642&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29642&r=float

Reply via email to