RSS
RSS

Test wyświetlania błędów PHP


Kategorie: Wszystkie

0

<h1>Testing if PHP errors are displayed</h1>
<p>How-to: First check that all errors display, then change the server settings, then no errors should show up.</p>
<?php

echo 'display_errors = ' . (int) ini_get('display_errors') . "<br><br>";

echo 'Notice, does not stop PHP execution: ';
trigger_error("TEST OF A NOTICE", E_USER_NOTICE);
echo '<br><br>';

echo 'Warning, does not stop PHP execution: ';
trigger_error("TEST OF A WARNING", E_USER_WARNING);
echo '<br><br>';

echo 'Error, stops PHP execution: ';
trigger_error("TEST OF FATAL ERROR", E_USER_ERROR);
echo '<br><br>';

Komentuj

Subscribe without commenting