php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6653 Parser possibly broken. Doesn't respect comments.
Submitted: 2000-09-10 20:19 UTC Modified: 2000-09-10 20:25 UTC
From: bdonor at westnet dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.2 OS: Redhat Linux
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: bdonor at westnet dot com
New email:
PHP Version: OS:

 

 [2000-09-10 20:19 UTC] bdonor at westnet dot com
I have a piece of code like this:

<?php

// <?=$Username?>   Prints the username.
// <?=$Password?>   Prints the password.
// <?=$AccountType?>   Prints the account type.

?>

I assumed that all of this would be considered a comment and not executed (this was so our webmaster could just look at the top of our pages and see how to output the values he needed).

Unfortunately it prints this:

Prints the username. //    Prints the password. //    Prints the account type.

It treats the ?> inside the first comment as the end of a PHP block so the rest is just output to the screen (assuming it is HTML).  Shouldn't the parser ignore this whole line?

Forgive my ignorance if this is not how it is designed to work.

Thank you,
Tim Mattison
bdonor@westnet.com

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-10 20:25 UTC] joey@php.net
This is intentional.
See:
http://php.net/manual/language.basic-syntax.comments.php
Use /* */ instead.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 01 03:01:28 2024 UTC