Code Monkey home page Code Monkey logo

Comments (4)

neo-angeiras avatar neo-angeiras commented on May 20, 2024 4

I already adjust all my PHP files, just a few for my first Flight API (and, in fact, my first ever PHP job)

Thanks for the response.

from core.

n0nag0n avatar n0nag0n commented on May 20, 2024 2

Congrats on your first job! I remember my first job and how exciting it was. Please keep in touch to see how we can help you be as successful as possible!

from core.

n0nag0n avatar n0nag0n commented on May 20, 2024 1

So the reason why it's probably complain is because when you add // comments outside of PHP, it treats that like regular ol' plain text. The reason why it works in 2.0.2 is because it used to wipe out any output buffer before it even got started. You actually could probably have it still work <3.5.0 if you wanted. You also could use Flight::set('flight.v2.output_buffering', true); to make it work like it used to.

My recommendation going forward would be to put your comments actually inside the <?php tags so they are treated as such. Having "comments" outside of PHP code is not an intended use case.

from core.

BelleNottelling avatar BelleNottelling commented on May 20, 2024

To further add: it's not that comments written before <?php are treated like regular text it's that PHP doesn't even parse anything outside of a PHP tag it's and is simply kept as-is and added to the content of the page.

This is by design and a great example of why is actually on the PHP wiki:

<!DOCTYPE html>
<html>
    <head>
        <title>PHP Test</title>
    </head>
    <body>
        <?php echo '<p>Hello World</p>'; ?>
    </body>
</html>

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.