1.2.994. Print And Die¶

Die() also prints.

When stopping a script with die(), it is possible to provide a message as first argument, that will be displayed at execution. There is no need to make a specific call to print or echo.

<?php

//  die may do both print and die.
echo 'Error message';
die();

//  exit may do both print and die.
print 'Error message';
exit;

//  exit cannot print integers only : they will be used as status report to the system.
print 'Error message';
exit 1;

?>

1.2.994.1. Connex PHP features¶

  • print

  • die

1.2.994.1.1. Specs¶

Short name

Structures/PrintAndDie

Rulesets

All, Analyze, CE, CI-checks, Changed Behavior

Exakat since

0.8.4

PHP Version

All

Severity

Minor

Time To Fix

Instant (5 mins)

Precision

Very high

Available in

Entreprise Edition, Community Edition, Exakat Cloud

Exakat

Navigation

  • Introduction
  • Release Note

GETTING STARTED

  • Standard installation
  • Docker installation
  • Tutorials

USER GUIDE

  • Overview
  • PHP Version
  • Library & Framework Support
  • Configuration
  • Scoping analysis
  • Rule
  • Report
  • Cobbler

REFERENCE GUIDE

  • 1. Rules
  • 2. Rulesets
  • 3. Reports
  • 4. Cobblers
  • 5. Real Code Cases

ADMINISTRATOR GUIDE

  • Installation
  • Upgrading
  • Configuration
  • Commands

OTHERS

  • Frequently Asked Questions
  • Glossary
  • Annex

Related Topics

  • Documentation overview
    • 1. Rules
      • Previous: 1.2.993. Preprocessable
      • Next: 1.2.995. Printf Format Inventory
©2015-2025, Damien Seguy - Exakat. | Powered by Sphinx 9.0.4 & Alabaster 1.0.0 | Page source