Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, Mercure.rocks, Vulcain.rocks and of some Symfony components.

Menu
  • Talks
  • Resume
  • Sponsor me
  • Contact
Menu

PHP et ses tags

Posted on July 23, 2008July 27, 2008 by Kévin Dunglas

Il existe plusieurs manières de délimiter les blocs de code en PHP :

  • <?php et ?> (les tags standard)
  • <? et ?> (leur version courte)
  • <?= et ?> (équivalent de <?php echo et ?>)
  • <% et %> (style ASP)
  • <script language="php"> et </script> (style HTML)

Parmi tous ces tags, seul le couple <?php et ?> est générique et recomandé. Les tags de style HTML sont dépréciés et peu communs tandis que que les autres sont dépendants de la configuration de PHP et peuvent ne pas être disponibles.  Le code PHP contenu dans des blocs délimités par des tags non standards risque tout simplement de ne pas être exécuté et d’être affiché à l’écran sur certains serveurs !

Afin d’éviter tout problème leur de la distribution ou du déploiement de vos scripts, bannissez l’utilisation des formes de tags différentes de <?php et ?>.

Plus de bonnes pratiques ? PHP Talks !

Related posts:

  1. Ne fermez pas vos tags à la fin des fichiers PHP
  2. Tag Suggestion for symfony
  3. Un formulaire de création de compte avec Symfony et sfGuard
  4. Introducing Publish It Yourself: a self-managed libre CMS

Leave a Reply Cancel reply

Follow me on Twitter

My Tweets

Subscribe to this blog

Recent Posts

  • New in Caddy 2.5: Redact Sensitive Data from Your Logs
  • Building Decentralized Web Apps with Solid and PHP
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Preventing CORS Preflight Requests Using Content Negotiation
  • Symfony’s New Native Docker Support (Symfony World)

Top Posts & Pages

  • Building Decentralized Web Apps with Solid and PHP
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Using Next.js and Material UI Together
  • Generate a Symfony password hash from the command line
  • API Platform 2.6: PHP 8 support, Next.js and Nuxt.js app generator, Caddy server, ActivityPub and much more!
  • How to make high performance API powered webapps with Symfony (Symfony Live)
  • Symfony UX Turbo: Do You Still Need JavaScript?! (SymfonyWorld)
  • Symfony 4: HTTP/2 Push and Preloading
  • Preventing CORS Preflight Requests Using Content Negotiation
  • Connection to a MS SQL Server from Symfony / Doctrine on Mac or Linux

Persistence in PHP with the Doctrine ORM

Persistence in PHP with the Doctrine ORM

Tags

Android Apache API API Platform Buzz Caddy Docker Doctrine Go Google HTTP/2 Hydra hypermedia Hébergement Javascript JSON-LD Kubernetes La Coopérative des Tilleuls Les-Tilleuls.coop Lille Linux Mac Mercure Messagerie Instantanée MySQL Open Source PHP Punk Rock Python React REST Rock'n'Roll RSS Schema.org Security SEO SEO Symfony Symfony Live Sécurité Ubuntu Web 2.0 Wordpress XHTML XML

Archives

Categories

  • DevOps (24)
  • Mercure (3)
  • Opinions (91)
  • Programming (178)
    • Android (5)
    • Go (11)
    • JavaScript (43)
    • PHP (136)
      • API Platform (60)
      • Symfony (89)
    • Python (14)
      • Django (5)
  • Security (15)
  • SEO (24)
  • Talks (37)
  • Ubuntu (68)
  • Wordpress (6)

Blogoliste

  • API Platform
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks
© 2022 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme