Leçon N° 11 : Gestion des erreurs
La fonction 'set error handler' 1¤
Notes de page
Source: lesson_11_d_set_error_handler_function_1.phpRésultat
<?php
error_reporting
(E_ALL);
ini_set("display_errors"1);
// début du programme
//redefinition de la routine de gestion d'erreur
set_error_handler("eh");
// string
$string "L'important, c'est la rose";
// on génère un E_WARNING pour l'exemple
join(''$string);
//------------------------------------------------------------------
function eh($type$msg$file$line$context)
{
    echo 
"<h3>Erreur !</h3>";
    echo 
"Une erreur s'est produite. ";
    echo 
"<a href=mailto:webmaster@somedomain.com>Contacter le webmaster</a>";
    echo 
"<p>";
    echo 
"Les informations à transmettre sont les suivantes :<br/>";
    echo 
"Code d'erreur: $type <br/>";
    echo 
"Message: $msg <br/>";
    echo 
"Nom du programme et ligne où a eu lieu l'erreur: $file:$line<br/>";
    echo 
"Etat des variables au moment de l'erreur: <pre>";
    
print_r($context); 
    echo 
"</pre><hr>";
}
?>

Erreur !

Une erreur s'est produite. Contacter le webmaster

Les informations à transmettre sont les suivantes :
Code d'erreur: 2
Message: join(): Invalid arguments passed
Nom du programme et ligne où a eu lieu l'erreur: /home/marchons/autres_sites/atelierphp_net/exercises/lesson_11_d_set_error_handler_function_1.php:10
Etat des variables au moment de l'erreur:

Array
(
    [_GET] => Array
        (
            [exercise] => lesson_11_d_set_error_handler_function_1.php
        )

    [_POST] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [_FILES] => Array
        (
        )

    [_SERVER] => Array
        (
            [USER] => marchons
            [SCRIPT_NAME] => /commons/show_exercises.php
            [REQUEST_URI] => /commons/show_exercises.php?exercise=lesson_11_d_set_error_handler_function_1.php
            [QUERY_STRING] => exercise=lesson_11_d_set_error_handler_function_1.php
            [REQUEST_METHOD] => GET
            [SERVER_PROTOCOL] => HTTP/1.1
            [GATEWAY_INTERFACE] => CGI/1.1
            [REMOTE_PORT] => 56984
            [SCRIPT_FILENAME] => /home/marchons/autres_sites/atelierphp_net/commons/show_exercises.php
            [SERVER_ADMIN] => postmaster@atelierphp.net
            [REMOTE_ADDR] => 18.188.91.223
            [SERVER_PORT] => 80
            [SERVER_ADDR] => 10.14.20.2
            [SERVER_NAME] => atelierphp.net
            [SERVER_SOFTWARE] => Apache
            [SERVER_SIGNATURE] => 
            [HTTP_REMOTE_IP] => 18.188.91.223
            [HTTP_X_IPLB_UNIQUE_ID] => 12BC5BDF:944F_D5BA2157:0050_67401084_6D96:646D
            [HTTP_REMOTE_PORT] => 37967
            [HTTP_FORWARDED] => for=18.188.91.223; proto=http; host=atelierphp.net
            [HTTP_X_REMOTE_PROTO] => http
            [HTTP_X_REMOTE_IP] => 18.188.91.223
            [HTTP_X_REMOTE_PORT] => 37967
            [HTTP_X_FORWARDED_PORT] => 80
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_ACCEPT] => */*
            [HTTP_X_OVHREQUEST_ID] => 5da28f5324517a98cc8b5fdf9da8f2d9
            [HTTP_X_FORWARDED_PROTO] => http
            [HTTP_X_FORWARDED_FOR] => 18.188.91.223
            [HTTP_X_PREDICTOR] => 1
            [HTTP_HOST] => atelierphp.net
            [CFG_CLUSTER] => cluster014
            [SCRIPT_URI] => http://atelierphp.net/commons/show_exercises.php
            [SCRIPT_URL] => /commons/show_exercises.php
            [GEOIP_LONGITUDE] => -83.006104
            [GEOIP_LATITUDE] => 39.962502
            [GEOIP_AREA_CODE] => 614
            [GEOIP_DMA_CODE] => 535
            [GEOIP_CITY] => Columbus
            [GEOIP_REGION] => OH
            [GEOIP_COUNTRY_NAME] => United States
            [GEOIP_COUNTRY_CODE] => US
            [UNIQUE_ID] => Z0AQhFstKz5aH9S-qMq9dAAAAJA
            [DOCUMENT_ROOT] => /home/marchons/autres_sites/atelierphp_net
            [ENVIRONMENT] => production
            [APP_ENGINE_VERSION] => 7.4
            [APP_ENGINE] => php
            [FCGI_ROLE] => RESPONDER
            [PHP_SELF] => /commons/show_exercises.php
            [REQUEST_TIME_FLOAT] => 1732251780.1623
            [REQUEST_TIME] => 1732251780
            [argv] => Array
                (
                    [0] => exercise=lesson_11_d_set_error_handler_function_1.php
                )

            [argc] => 1
        )

    [_REQUEST] => Array
        (
            [exercise] => lesson_11_d_set_error_handler_function_1.php
        )

    [_ENV] => Array
        (
            [USER] => marchons
            [SCRIPT_NAME] => /commons/show_exercises.php
            [REQUEST_URI] => /commons/show_exercises.php?exercise=lesson_11_d_set_error_handler_function_1.php
            [QUERY_STRING] => exercise=lesson_11_d_set_error_handler_function_1.php
            [REQUEST_METHOD] => GET
            [SERVER_PROTOCOL] => HTTP/1.1
            [GATEWAY_INTERFACE] => CGI/1.1
            [REMOTE_PORT] => 56984
            [SCRIPT_FILENAME] => /home/marchons/autres_sites/atelierphp_net/commons/show_exercises.php
            [SERVER_ADMIN] => postmaster@atelierphp.net
            [REMOTE_ADDR] => 18.188.91.223
            [SERVER_PORT] => 80
            [SERVER_ADDR] => 10.14.20.2
            [SERVER_NAME] => atelierphp.net
            [SERVER_SOFTWARE] => Apache
            [SERVER_SIGNATURE] => 
            [HTTP_REMOTE_IP] => 18.188.91.223
            [HTTP_X_IPLB_UNIQUE_ID] => 12BC5BDF:944F_D5BA2157:0050_67401084_6D96:646D
            [HTTP_REMOTE_PORT] => 37967
            [HTTP_FORWARDED] => for=18.188.91.223; proto=http; host=atelierphp.net
            [HTTP_X_REMOTE_PROTO] => http
            [HTTP_X_REMOTE_IP] => 18.188.91.223
            [HTTP_X_REMOTE_PORT] => 37967
            [HTTP_X_FORWARDED_PORT] => 80
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_ACCEPT] => */*
            [HTTP_X_OVHREQUEST_ID] => 5da28f5324517a98cc8b5fdf9da8f2d9
            [HTTP_X_FORWARDED_PROTO] => http
            [HTTP_X_FORWARDED_FOR] => 18.188.91.223
            [HTTP_X_PREDICTOR] => 1
            [HTTP_HOST] => atelierphp.net
            [CFG_CLUSTER] => cluster014
            [SCRIPT_URI] => http://atelierphp.net/commons/show_exercises.php
            [SCRIPT_URL] => /commons/show_exercises.php
            [GEOIP_LONGITUDE] => -83.006104
            [GEOIP_LATITUDE] => 39.962502
            [GEOIP_AREA_CODE] => 614
            [GEOIP_DMA_CODE] => 535
            [GEOIP_CITY] => Columbus
            [GEOIP_REGION] => OH
            [GEOIP_COUNTRY_NAME] => United States
            [GEOIP_COUNTRY_CODE] => US
            [UNIQUE_ID] => Z0AQhFstKz5aH9S-qMq9dAAAAJA
            [DOCUMENT_ROOT] => /home/marchons/autres_sites/atelierphp_net
            [ENVIRONMENT] => production
            [APP_ENGINE_VERSION] => 7.4
            [APP_ENGINE] => php
            [FCGI_ROLE] => RESPONDER
            [PHP_SELF] => /commons/show_exercises.php
            [REQUEST_TIME_FLOAT] => 1732251780.1623
            [REQUEST_TIME] => 1732251780
            [argv] => Array
                (
                    [0] => exercise=lesson_11_d_set_error_handler_function_1.php
                )

            [argc] => 1
        )

    [GLOBALS] => Array
        (
            [_GET] => Array
                (
                    [exercise] => lesson_11_d_set_error_handler_function_1.php
                )

            [_POST] => Array
                (
                )

            [_COOKIE] => Array
                (
                )

            [_FILES] => Array
                (
                )

            [_SERVER] => Array
                (
                    [USER] => marchons
                    [SCRIPT_NAME] => /commons/show_exercises.php
                    [REQUEST_URI] => /commons/show_exercises.php?exercise=lesson_11_d_set_error_handler_function_1.php
                    [QUERY_STRING] => exercise=lesson_11_d_set_error_handler_function_1.php
                    [REQUEST_METHOD] => GET
                    [SERVER_PROTOCOL] => HTTP/1.1
                    [GATEWAY_INTERFACE] => CGI/1.1
                    [REMOTE_PORT] => 56984
                    [SCRIPT_FILENAME] => /home/marchons/autres_sites/atelierphp_net/commons/show_exercises.php
                    [SERVER_ADMIN] => postmaster@atelierphp.net
                    [REMOTE_ADDR] => 18.188.91.223
                    [SERVER_PORT] => 80
                    [SERVER_ADDR] => 10.14.20.2
                    [SERVER_NAME] => atelierphp.net
                    [SERVER_SOFTWARE] => Apache
                    [SERVER_SIGNATURE] => 
                    [HTTP_REMOTE_IP] => 18.188.91.223
                    [HTTP_X_IPLB_UNIQUE_ID] => 12BC5BDF:944F_D5BA2157:0050_67401084_6D96:646D
                    [HTTP_REMOTE_PORT] => 37967
                    [HTTP_FORWARDED] => for=18.188.91.223; proto=http; host=atelierphp.net
                    [HTTP_X_REMOTE_PROTO] => http
                    [HTTP_X_REMOTE_IP] => 18.188.91.223
                    [HTTP_X_REMOTE_PORT] => 37967
                    [HTTP_X_FORWARDED_PORT] => 80
                    [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
                    [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
                    [HTTP_ACCEPT] => */*
                    [HTTP_X_OVHREQUEST_ID] => 5da28f5324517a98cc8b5fdf9da8f2d9
                    [HTTP_X_FORWARDED_PROTO] => http
                    [HTTP_X_FORWARDED_FOR] => 18.188.91.223
                    [HTTP_X_PREDICTOR] => 1
                    [HTTP_HOST] => atelierphp.net
                    [CFG_CLUSTER] => cluster014
                    [SCRIPT_URI] => http://atelierphp.net/commons/show_exercises.php
                    [SCRIPT_URL] => /commons/show_exercises.php
                    [GEOIP_LONGITUDE] => -83.006104
                    [GEOIP_LATITUDE] => 39.962502
                    [GEOIP_AREA_CODE] => 614
                    [GEOIP_DMA_CODE] => 535
                    [GEOIP_CITY] => Columbus
                    [GEOIP_REGION] => OH
                    [GEOIP_COUNTRY_NAME] => United States
                    [GEOIP_COUNTRY_CODE] => US
                    [UNIQUE_ID] => Z0AQhFstKz5aH9S-qMq9dAAAAJA
                    [DOCUMENT_ROOT] => /home/marchons/autres_sites/atelierphp_net
                    [ENVIRONMENT] => production
                    [APP_ENGINE_VERSION] => 7.4
                    [APP_ENGINE] => php
                    [FCGI_ROLE] => RESPONDER
                    [PHP_SELF] => /commons/show_exercises.php
                    [REQUEST_TIME_FLOAT] => 1732251780.1623
                    [REQUEST_TIME] => 1732251780
                    [argv] => Array
                        (
                            [0] => exercise=lesson_11_d_set_error_handler_function_1.php
                        )

                    [argc] => 1
                )

            [_REQUEST] => Array
                (
                    [exercise] => lesson_11_d_set_error_handler_function_1.php
                )

            [_ENV] => Array
                (
                    [USER] => marchons
                    [SCRIPT_NAME] => /commons/show_exercises.php
                    [REQUEST_URI] => /commons/show_exercises.php?exercise=lesson_11_d_set_error_handler_function_1.php
                    [QUERY_STRING] => exercise=lesson_11_d_set_error_handler_function_1.php
                    [REQUEST_METHOD] => GET
                    [SERVER_PROTOCOL] => HTTP/1.1
                    [GATEWAY_INTERFACE] => CGI/1.1
                    [REMOTE_PORT] => 56984
                    [SCRIPT_FILENAME] => /home/marchons/autres_sites/atelierphp_net/commons/show_exercises.php
                    [SERVER_ADMIN] => postmaster@atelierphp.net
                    [REMOTE_ADDR] => 18.188.91.223
                    [SERVER_PORT] => 80
                    [SERVER_ADDR] => 10.14.20.2
                    [SERVER_NAME] => atelierphp.net
                    [SERVER_SOFTWARE] => Apache
                    [SERVER_SIGNATURE] => 
                    [HTTP_REMOTE_IP] => 18.188.91.223
                    [HTTP_X_IPLB_UNIQUE_ID] => 12BC5BDF:944F_D5BA2157:0050_67401084_6D96:646D
                    [HTTP_REMOTE_PORT] => 37967
                    [HTTP_FORWARDED] => for=18.188.91.223; proto=http; host=atelierphp.net
                    [HTTP_X_REMOTE_PROTO] => http
                    [HTTP_X_REMOTE_IP] => 18.188.91.223
                    [HTTP_X_REMOTE_PORT] => 37967
                    [HTTP_X_FORWARDED_PORT] => 80
                    [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
                    [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
                    [HTTP_ACCEPT] => */*
                    [HTTP_X_OVHREQUEST_ID] => 5da28f5324517a98cc8b5fdf9da8f2d9
                    [HTTP_X_FORWARDED_PROTO] => http
                    [HTTP_X_FORWARDED_FOR] => 18.188.91.223
                    [HTTP_X_PREDICTOR] => 1
                    [HTTP_HOST] => atelierphp.net
                    [CFG_CLUSTER] => cluster014
                    [SCRIPT_URI] => http://atelierphp.net/commons/show_exercises.php
                    [SCRIPT_URL] => /commons/show_exercises.php
                    [GEOIP_LONGITUDE] => -83.006104
                    [GEOIP_LATITUDE] => 39.962502
                    [GEOIP_AREA_CODE] => 614
                    [GEOIP_DMA_CODE] => 535
                    [GEOIP_CITY] => Columbus
                    [GEOIP_REGION] => OH
                    [GEOIP_COUNTRY_NAME] => United States
                    [GEOIP_COUNTRY_CODE] => US
                    [UNIQUE_ID] => Z0AQhFstKz5aH9S-qMq9dAAAAJA
                    [DOCUMENT_ROOT] => /home/marchons/autres_sites/atelierphp_net
                    [ENVIRONMENT] => production
                    [APP_ENGINE_VERSION] => 7.4
                    [APP_ENGINE] => php
                    [FCGI_ROLE] => RESPONDER
                    [PHP_SELF] => /commons/show_exercises.php
                    [REQUEST_TIME_FLOAT] => 1732251780.1623
                    [REQUEST_TIME] => 1732251780
                    [argv] => Array
                        (
                            [0] => exercise=lesson_11_d_set_error_handler_function_1.php
                        )

                    [argc] => 1
                )

            [GLOBALS] => Array
 *RECURSION*
            [current_file] => lesson_11_d_set_error_handler_function_1.php
            [exercise] => lesson_11_d_set_error_handler_function_1.php
            [index] => 14
            [chapitre] => 11
            [param] => d_set_error_handler_function_1
            [file_name] => lesson_11_d_set_error_handler_function_1.php
            [file_to_load] => Array
                (
                    [0] => lesson_11_a0_notice.php|Exemple de message 'notice'|1|Comment ne plus avoir de notice lorsque, arrivé à cet endroit du déroulement du programme, on ne sait pas si $message_1 a été chargé ou pas (On veut afficher sa valeur seulement si cette variable a été chargée)|**

                    [1] => lesson_11_a_warning.php|Exemple de mesage 'warning'|1|Juste deux caractères à rajouter pour supprimer l'erreur|*

                    [2] => lesson_11_b_fatal.php|Exemple de message 'fatal'|0| |¤

                    [3] => lesson_11_c0_error_reporting_function.php|N'afficher que les erreurs 'notice' |1|Quelle est la syntaxe recommandée PHP4  pour obtenir le même résultat|*

                    [4] => lesson_11_c1_error_reporting_function.php|N'afficher que les erreurs fatales |1|En notation PHP4, comment faire pour ne pas afficher ce message d'erreur fatale ? |*

                    [5] => lesson_11_c2_error_reporting_function.php|Affichage des erreurs |1|Comment peut-on écrire 'all errors except E_USER_NOTICE' à l'aide des opérateurs logiques.|*

                    [6] => lesson_11_c3_error_reporting_function.php|Supprimer facilement tous les messages d'erreur|1|Comment ne pas avoir de message d'erreur sans utiliser la fonction error_reporting() ?|*

                    [7] => lesson_11_c4_error_reporting_function.php|Fonction 'error reporting' sans argument |0| |¤

                    [8] => lesson_11_d_set_error_handler_function_1.php|La fonction 'set error handler' 1|0| |¤

                    [9] => lesson_11_e_set_error_handler_function_2.php|La fonction 'set error handler' 2|0| |¤

                    [10] => lesson_11_f_set_error_handler_function_3.php|La fonction 'set error handler' 3|0| |¤

                    [11] => lesson_11_g_set_error_handler_function_4.php|La fonction 'set error handler' 4|0| |¤

                    [12] => lesson_11_h_set_error_handler_function_5.php|La fonction 'set error handler' 5|0| |¤

                    [13] => lesson_11_php5_exception.php|Gestion des exceptions en PHP5|1|Changer tous les messages et la condition pour laquelle l'exception se produit|**

                )

            [token_table] => Array
                (
                    [0] => lesson_11_php5_exception.php
                    [1] => La fonction 'set error handler' 1
                    [2] => 0
                    [3] =>  
                    [4] => ¤

                    [5] => 
                    [6] => 
                    [7] => 
                    [8] => 
                    [9] => 
                    [10] => 
                    [11] => 
                    [12] => 
                    [13] => 
                    [14] => 
                    [15] => 
                )

            [i] => 16
            [titre] => La fonction 'set error handler' 1
            [solution] => 0
            [question] => 
            [level] => ¤
            [pageName] => La fonction \'set error handler\' 1
            [visitedpage_type] => Exercice
            [sources] => Array
                (
                    [5] => 
                    [6] => 
                    [7] => 
                    [8] => 
                    [9] => 
                    [10] => 
                    [11] => 
                    [12] => 
                    [13] => 
                    [14] => 
                    [15] => 
                )

            [CHAPTER_dir] => Array
                (
                    [01] => environnement
                    [02] => variables
                    [03] => operators
                    [04] => control_structures
                    [05] => arrays
                    [06] => functions
                    [07] => forms
                    [08] => classes
                    [09] => mysql_1
                    [10] => dates
                    [11] => error_handling
                    [12] => i_o_functions
                    [13] => authentication
                    [14] => persistence
                    [15] => mysql_2
                    [16] => string_manipulation
                    [17] => images
                    [18] => i_o_to_navigator
                    [19] => environment
                    [20] => mailing
                )

            [CHAPTER_titre] => Array
                (
                    [0] => Questions diverses
                    [01] => Installation, Environnement
                    [02] => Les Variables
                    [03] => Opérateurs
                    [04] => Structures de controle
                    [05] => Tableaux
                    [06] => Fonctions
                    [07] => Formulaires
                    [08] => Classes et objets
                    [09] => Mysql première partie : introduction
                    [10] => Dates
                    [11] => Gestion des erreurs
                    [12] => Gestion des fichiers
                    [13] => Autentification : mot de passe, sécurité
                    [14] => Conserver des valeurs d´une page à l´autre
                    [15] => Mysql 2ième partie : liaisons entre tables
                    [16] => Fonctions de manipulations de texte
                    [17] => Création / Manipulation des images
                    [18] => Les entrées/sorties vers le navigateur
                    [19] => Les variables d environnement
                    [20] => Courrier, réseau
                )

            [_SESSION] => Array
                (
                    [user_name] => 
                    [visit_number] => 2336499
                    [current_file] => lesson_11_d_set_error_handler_function_1.php
                    [titre] => La fonction 'set error handler' 1
                    [solution] => 0
                    [question] => 
                    [level] => ¤
                    [sources] => 
                )

            [host] => marchonstous.mysql.db
            [user] => marchonstous
            [pass] => 12aVHaESGa30
            [db] => marchonstous
            [mysqli] => mysqli Object
                (
                    [affected_rows] => 1
                    [client_info] => mysqlnd 7.4.33
                    [client_version] => 70433
                    [connect_errno] => 0
                    [connect_error] => 
                    [errno] => 0
                    [error] => 
                    [error_list] => Array
                        (
                        )

                    [field_count] => 0
                    [host_info] => marchonstous.mysql.db via TCP/IP
                    [info] => 
                    [insert_id] => 1505817
                    [server_info] => 8.0.39-30
                    [server_version] => 80039
                    [sqlstate] => 00000
                    [protocol_version] => 10
                    [thread_id] => 246043
                    [warning_count] => 0
                )

            [result] => mysqli_result Object
                (
                    [current_field] => 0
                    [field_count] => 1
                    [lengths] => Array
                        (
                            [0] => 7
                        )

                    [num_rows] => 1
                    [type] => 0
                )

            [CHAPTER_number] => Array
                (
                    [01] => 01
                    [02] => 02
                    [03] => 03
                    [04] => 04
                    [05] => 05
                    [06] => 06
                    [07] => 07
                    [08] => 08
                    [09] => 09
                    [10] => 10
                    [11] => 11
                    [12] => 12
                    [13] => 13
                    [14] => 14
                    [15] => 15
                    [16] => 16
                    [17] => 17
                    [18] => 18
                    [19] => 19
                    [20] => 20
                )

            [row] => Array
                (
                    [0] => 2336499
                    [VISIT_ID] => 2336499
                )

            [chapter_title_2] => Array
                (
                    [01] => installation et environnement
                    [02] => les variables
                    [03] => les opérateurs
                    [04] => les structures de contrôle
                    [05] => les tableaux
                    [06] => les fonctions
                    [07] => les formulaires
                    [08] => les classes et objets
                    [09] => MySQL première partie
                    [10] => les dates
                    [11] => la gestion des erreurs
                    [12] => les fichiers et répertoires
                    [13] => l'autentification
                    [14] => le passage de valeurs d'une page à l'autre
                    [15] => MySQL seconde partie
                    [16] => la manipulation des chaines
                    [17] => les images
                    [18] => les entrées-sorties vers le navigateur
                    [19] => les variables d'environnement
                    [20] => le courrier, le transfer des fichiers
                )

            [nb_lessons] => 20
            [host_name] => atelierph
            [localServer] => 0
            [pages_table_name] => atelierphp_sys_visitedpages_utf8
            [visits_table_name] => atelierphp_sys_visits_utf8
            [webStats_visit_number] => 2336499
            [Session_ID] => f2af85f6659e6bf4b81f3499669af26b
            [visit_id] => 2336499
            [visit_number] => 
            [string] => L'important, c'est la rose
        )

    [current_file] => lesson_11_d_set_error_handler_function_1.php
    [exercise] => lesson_11_d_set_error_handler_function_1.php
    [index] => 14
    [chapitre] => 11
    [param] => d_set_error_handler_function_1
    [file_name] => lesson_11_d_set_error_handler_function_1.php
    [file_to_load] => Array
        (
            [0] => lesson_11_a0_notice.php|Exemple de message 'notice'|1|Comment ne plus avoir de notice lorsque, arrivé à cet endroit du déroulement du programme, on ne sait pas si $message_1 a été chargé ou pas (On veut afficher sa valeur seulement si cette variable a été chargée)|**

            [1] => lesson_11_a_warning.php|Exemple de mesage 'warning'|1|Juste deux caractères à rajouter pour supprimer l'erreur|*

            [2] => lesson_11_b_fatal.php|Exemple de message 'fatal'|0| |¤

            [3] => lesson_11_c0_error_reporting_function.php|N'afficher que les erreurs 'notice' |1|Quelle est la syntaxe recommandée PHP4  pour obtenir le même résultat|*

            [4] => lesson_11_c1_error_reporting_function.php|N'afficher que les erreurs fatales |1|En notation PHP4, comment faire pour ne pas afficher ce message d'erreur fatale ? |*

            [5] => lesson_11_c2_error_reporting_function.php|Affichage des erreurs |1|Comment peut-on écrire 'all errors except E_USER_NOTICE' à l'aide des opérateurs logiques.|*

            [6] => lesson_11_c3_error_reporting_function.php|Supprimer facilement tous les messages d'erreur|1|Comment ne pas avoir de message d'erreur sans utiliser la fonction error_reporting() ?|*

            [7] => lesson_11_c4_error_reporting_function.php|Fonction 'error reporting' sans argument |0| |¤

            [8] => lesson_11_d_set_error_handler_function_1.php|La fonction 'set error handler' 1|0| |¤

            [9] => lesson_11_e_set_error_handler_function_2.php|La fonction 'set error handler' 2|0| |¤

            [10] => lesson_11_f_set_error_handler_function_3.php|La fonction 'set error handler' 3|0| |¤

            [11] => lesson_11_g_set_error_handler_function_4.php|La fonction 'set error handler' 4|0| |¤

            [12] => lesson_11_h_set_error_handler_function_5.php|La fonction 'set error handler' 5|0| |¤

            [13] => lesson_11_php5_exception.php|Gestion des exceptions en PHP5|1|Changer tous les messages et la condition pour laquelle l'exception se produit|**

        )

    [token_table] => Array
        (
            [0] => lesson_11_php5_exception.php
            [1] => La fonction 'set error handler' 1
            [2] => 0
            [3] =>  
            [4] => ¤

            [5] => 
            [6] => 
            [7] => 
            [8] => 
            [9] => 
            [10] => 
            [11] => 
            [12] => 
            [13] => 
            [14] => 
            [15] => 
        )

    [i] => 16
    [titre] => La fonction 'set error handler' 1
    [solution] => 0
    [question] => 
    [level] => ¤
    [pageName] => La fonction \'set error handler\' 1
    [visitedpage_type] => Exercice
    [sources] => Array
        (
            [5] => 
            [6] => 
            [7] => 
            [8] => 
            [9] => 
            [10] => 
            [11] => 
            [12] => 
            [13] => 
            [14] => 
            [15] => 
        )

    [CHAPTER_dir] => Array
        (
            [01] => environnement
            [02] => variables
            [03] => operators
            [04] => control_structures
            [05] => arrays
            [06] => functions
            [07] => forms
            [08] => classes
            [09] => mysql_1
            [10] => dates
            [11] => error_handling
            [12] => i_o_functions
            [13] => authentication
            [14] => persistence
            [15] => mysql_2
            [16] => string_manipulation
            [17] => images
            [18] => i_o_to_navigator
            [19] => environment
            [20] => mailing
        )

    [CHAPTER_titre] => Array
        (
            [0] => Questions diverses
            [01] => Installation, Environnement
            [02] => Les Variables
            [03] => Opérateurs
            [04] => Structures de controle
            [05] => Tableaux
            [06] => Fonctions
            [07] => Formulaires
            [08] => Classes et objets
            [09] => Mysql première partie : introduction
            [10] => Dates
            [11] => Gestion des erreurs
            [12] => Gestion des fichiers
            [13] => Autentification : mot de passe, sécurité
            [14] => Conserver des valeurs d´une page à l´autre
            [15] => Mysql 2ième partie : liaisons entre tables
            [16] => Fonctions de manipulations de texte
            [17] => Création / Manipulation des images
            [18] => Les entrées/sorties vers le navigateur
            [19] => Les variables d environnement
            [20] => Courrier, réseau
        )

    [_SESSION] => Array
        (
            [user_name] => 
            [visit_number] => 2336499
            [current_file] => lesson_11_d_set_error_handler_function_1.php
            [titre] => La fonction 'set error handler' 1
            [solution] => 0
            [question] => 
            [level] => ¤
            [sources] => 
        )

    [host] => marchonstous.mysql.db
    [user] => marchonstous
    [pass] => 12aVHaESGa30
    [db] => marchonstous
    [mysqli] => mysqli Object
        (
            [affected_rows] => 1
            [client_info] => mysqlnd 7.4.33
            [client_version] => 70433
            [connect_errno] => 0
            [connect_error] => 
            [errno] => 0
            [error] => 
            [error_list] => Array
                (
                )

            [field_count] => 0
            [host_info] => marchonstous.mysql.db via TCP/IP
            [info] => 
            [insert_id] => 1505817
            [server_info] => 8.0.39-30
            [server_version] => 80039
            [sqlstate] => 00000
            [protocol_version] => 10
            [thread_id] => 246043
            [warning_count] => 0
        )

    [result] => mysqli_result Object
        (
            [current_field] => 0
            [field_count] => 1
            [lengths] => Array
                (
                    [0] => 7
                )

            [num_rows] => 1
            [type] => 0
        )

    [CHAPTER_number] => Array
        (
            [01] => 01
            [02] => 02
            [03] => 03
            [04] => 04
            [05] => 05
            [06] => 06
            [07] => 07
            [08] => 08
            [09] => 09
            [10] => 10
            [11] => 11
            [12] => 12
            [13] => 13
            [14] => 14
            [15] => 15
            [16] => 16
            [17] => 17
            [18] => 18
            [19] => 19
            [20] => 20
        )

    [row] => Array
        (
            [0] => 2336499
            [VISIT_ID] => 2336499
        )

    [chapter_title_2] => Array
        (
            [01] => installation et environnement
            [02] => les variables
            [03] => les opérateurs
            [04] => les structures de contrôle
            [05] => les tableaux
            [06] => les fonctions
            [07] => les formulaires
            [08] => les classes et objets
            [09] => MySQL première partie
            [10] => les dates
            [11] => la gestion des erreurs
            [12] => les fichiers et répertoires
            [13] => l'autentification
            [14] => le passage de valeurs d'une page à l'autre
            [15] => MySQL seconde partie
            [16] => la manipulation des chaines
            [17] => les images
            [18] => les entrées-sorties vers le navigateur
            [19] => les variables d'environnement
            [20] => le courrier, le transfer des fichiers
        )

    [nb_lessons] => 20
    [host_name] => atelierph
    [localServer] => 0
    [pages_table_name] => atelierphp_sys_visitedpages_utf8
    [visits_table_name] => atelierphp_sys_visits_utf8
    [webStats_visit_number] => 2336499
    [Session_ID] => f2af85f6659e6bf4b81f3499669af26b
    [visit_id] => 2336499
    [visit_number] => 
    [string] => L'important, c'est la rose
)


Tous droits réservés. 2005-2020