php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50322 php5.2.11 breaks with <
Submitted: 2009-11-29 08:00 UTC Modified: 2009-11-30 00:50 UTC
From: rafarataneneces at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.11 OS: Cent Os 64bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rafarataneneces at gmail dot com
New email:
PHP Version: OS:

 

 [2009-11-29 08:00 UTC] rafarataneneces at gmail dot com
Description:
------------
PHP breaks when I add "<" to any string

For example

$test="Test<ing";

echo $test

the result would be

Test

Instead of

Testing

This ONLY happens when running using the apache module.

If I run with command line, with the PHP binary, it works ok

Reproduce code:
---------------
$test="Testing<br>\n";
$test.="adding string\n";
$test.="<testing>\n";
echo $test;

Expected result:
----------------
Testing<br>
adding string
<testing>

Actual result:
--------------
Testing
adding string

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-29 08:01 UTC] rafarataneneces at gmail dot com
Description:
------------
PHP breaks when I add "<" to any string

For example

$test="Test<ing";

echo $test

the result would be

Test

Instead of

Test<ing

This ONLY happens when running using the apache module.

If I run with command line, with the PHP binary, it works ok

Reproduce code:
---------------
$test="Testing<br>\n";
$test.="adding string\n";
$test.="<testing>\n";
echo $test;

Expected result:
----------------
Testing<br>
adding string
<testing>

Actual result:
--------------
Testing
adding string
 [2009-11-29 08:37 UTC] rasmus@php.net
Uh, you did a "view source" right?
 [2009-11-29 16:13 UTC] rafarataneneces at gmail dot com
yeah rasmus@php.net
 [2009-11-29 16:21 UTC] rasmus@php.net
If you did a view source you would see the raw <> tags there.  PHP 
prints them out nicely.  It is your browser interpreting them as html 
tags which means you can only see them when you view the source. 
 [2009-11-30 00:50 UTC] rafarataneneces at gmail dot com
Testing<br> 
add string<br> 
<testing><br> 


Oh ok, I got it

so my browser thinks it's HTML?

I thought it was PHP error
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 17:01:33 2025 UTC