Testing Error Handling

An error occurred in script '/home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php' on line 38: Undefined variable: var
Array
(
    [_GET] => Array
        (
        )

    [_POST] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [_FILES] => Array
        (
        )

    [_SERVER] => Array
        (
            [LSPHP_ENABLE_USER_INI] => on
            [PATH] => /usr/local/bin:/usr/bin:/bin
            [TEMP] => /tmp
            [TMP] => /tmp
            [TMPDIR] => /tmp
            [PWD] => /
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [CONTENT_LENGTH] => 0
            [HTTP_HOST] => shopgi.com
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [UNIQUE_ID] => aMsD2yf6gLy8xllkVNLKEwAAEzA
            [SCRIPT_URL] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [SCRIPT_URI] => https://shopgi.com/garyjeurink/addons/0-php2/ch07/handle_errors.php
            [USER_ID] => 5489533
            [HTTPS] => on
            [SSL_TLS_SNI] => shopgi.com
            [HTTP2] => on
            [H2PUSH] => off
            [H2_PUSH] => off
            [H2_PUSHED] => 
            [H2_PUSHED_ON] => 
            [H2_STREAM_ID] => 63
            [H2_STREAM_TAG] => 2640893-164-63
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SERVER_NAME] => shopgi.com
            [SERVER_ADDR] => 160.153.44.64
            [SERVER_PORT] => 443
            [REMOTE_ADDR] => 216.73.216.168
            [DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html
            [REQUEST_SCHEME] => https
            [CONTEXT_PREFIX] => 
            [CONTEXT_DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html
            [SERVER_ADMIN] => webmaster@shopgi.com
            [SCRIPT_FILENAME] => /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php
            [REMOTE_PORT] => 59370
            [SERVER_PROTOCOL] => HTTP/2.0
            [REQUEST_METHOD] => GET
            [QUERY_STRING] => 
            [REQUEST_URI] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [SCRIPT_NAME] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [PHP_SELF] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [REQUEST_TIME_FLOAT] => 1758135259.8298
            [REQUEST_TIME] => 1758135259
        )

)

#0  my_error_handler(8, Undefined variable: var, /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php, 38, Array ([_GET] => Array (),[_POST] => Array (),[_COOKIE] => Array (),[_FILES] => Array (),[_SERVER] => Array ([LSPHP_ENABLE_USER_INI] => on,[PATH] => /usr/local/bin:/usr/bin:/bin,[TEMP] => /tmp,[TMP] => /tmp,[TMPDIR] => /tmp,[PWD] => /,[HTTP_ACCEPT] => */*,[HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate,[CONTENT_LENGTH] => 0,[HTTP_HOST] => shopgi.com,[HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com),[HTTP_X_HTTPS] => 1,[UNIQUE_ID] => aMsD2yf6gLy8xllkVNLKEwAAEzA,[SCRIPT_URL] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[SCRIPT_URI] => https://shopgi.com/garyjeurink/addons/0-php2/ch07/handle_errors.php,[USER_ID] => 5489533,[HTTPS] => on,[SSL_TLS_SNI] => shopgi.com,[HTTP2] => on,[H2PUSH] => off,[H2_PUSH] => off,[H2_PUSHED] => ,[H2_PUSHED_ON] => ,[H2_STREAM_ID] => 63,[H2_STREAM_TAG] => 2640893-164-63,[SERVER_SIGNATURE] => ,[SERVER_SOFTWARE] => Apache,[SERVER_NAME] => shopgi.com,[SERVER_ADDR] => 160.153.44.64,[SERVER_PORT] => 443,[REMOTE_ADDR] => 216.73.216.168,[DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html,[REQUEST_SCHEME] => https,[CONTEXT_PREFIX] => ,[CONTEXT_DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html,[SERVER_ADMIN] => webmaster@shopgi.com,[SCRIPT_FILENAME] => /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php,[REMOTE_PORT] => 59370,[SERVER_PROTOCOL] => HTTP/2.0,[REQUEST_METHOD] => GET,[QUERY_STRING] => ,[REQUEST_URI] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[SCRIPT_NAME] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[PHP_SELF] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[REQUEST_TIME_FLOAT] => 1758135259.8298,[REQUEST_TIME] => 1758135259))) called at [/home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php:38]

An error occurred in script '/home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php' on line 38: Invalid argument supplied for foreach()
Array
(
    [_GET] => Array
        (
        )

    [_POST] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [_FILES] => Array
        (
        )

    [_SERVER] => Array
        (
            [LSPHP_ENABLE_USER_INI] => on
            [PATH] => /usr/local/bin:/usr/bin:/bin
            [TEMP] => /tmp
            [TMP] => /tmp
            [TMPDIR] => /tmp
            [PWD] => /
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [CONTENT_LENGTH] => 0
            [HTTP_HOST] => shopgi.com
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [UNIQUE_ID] => aMsD2yf6gLy8xllkVNLKEwAAEzA
            [SCRIPT_URL] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [SCRIPT_URI] => https://shopgi.com/garyjeurink/addons/0-php2/ch07/handle_errors.php
            [USER_ID] => 5489533
            [HTTPS] => on
            [SSL_TLS_SNI] => shopgi.com
            [HTTP2] => on
            [H2PUSH] => off
            [H2_PUSH] => off
            [H2_PUSHED] => 
            [H2_PUSHED_ON] => 
            [H2_STREAM_ID] => 63
            [H2_STREAM_TAG] => 2640893-164-63
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SERVER_NAME] => shopgi.com
            [SERVER_ADDR] => 160.153.44.64
            [SERVER_PORT] => 443
            [REMOTE_ADDR] => 216.73.216.168
            [DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html
            [REQUEST_SCHEME] => https
            [CONTEXT_PREFIX] => 
            [CONTEXT_DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html
            [SERVER_ADMIN] => webmaster@shopgi.com
            [SCRIPT_FILENAME] => /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php
            [REMOTE_PORT] => 59370
            [SERVER_PROTOCOL] => HTTP/2.0
            [REQUEST_METHOD] => GET
            [QUERY_STRING] => 
            [REQUEST_URI] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [SCRIPT_NAME] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [PHP_SELF] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [REQUEST_TIME_FLOAT] => 1758135259.8298
            [REQUEST_TIME] => 1758135259
        )

)

#0  my_error_handler(2, Invalid argument supplied for foreach(), /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php, 38, Array ([_GET] => Array (),[_POST] => Array (),[_COOKIE] => Array (),[_FILES] => Array (),[_SERVER] => Array ([LSPHP_ENABLE_USER_INI] => on,[PATH] => /usr/local/bin:/usr/bin:/bin,[TEMP] => /tmp,[TMP] => /tmp,[TMPDIR] => /tmp,[PWD] => /,[HTTP_ACCEPT] => */*,[HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate,[CONTENT_LENGTH] => 0,[HTTP_HOST] => shopgi.com,[HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com),[HTTP_X_HTTPS] => 1,[UNIQUE_ID] => aMsD2yf6gLy8xllkVNLKEwAAEzA,[SCRIPT_URL] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[SCRIPT_URI] => https://shopgi.com/garyjeurink/addons/0-php2/ch07/handle_errors.php,[USER_ID] => 5489533,[HTTPS] => on,[SSL_TLS_SNI] => shopgi.com,[HTTP2] => on,[H2PUSH] => off,[H2_PUSH] => off,[H2_PUSHED] => ,[H2_PUSHED_ON] => ,[H2_STREAM_ID] => 63,[H2_STREAM_TAG] => 2640893-164-63,[SERVER_SIGNATURE] => ,[SERVER_SOFTWARE] => Apache,[SERVER_NAME] => shopgi.com,[SERVER_ADDR] => 160.153.44.64,[SERVER_PORT] => 443,[REMOTE_ADDR] => 216.73.216.168,[DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html,[REQUEST_SCHEME] => https,[CONTEXT_PREFIX] => ,[CONTEXT_DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html,[SERVER_ADMIN] => webmaster@shopgi.com,[SCRIPT_FILENAME] => /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php,[REMOTE_PORT] => 59370,[SERVER_PROTOCOL] => HTTP/2.0,[REQUEST_METHOD] => GET,[QUERY_STRING] => ,[REQUEST_URI] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[SCRIPT_NAME] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[PHP_SELF] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[REQUEST_TIME_FLOAT] => 1758135259.8298,[REQUEST_TIME] => 1758135259))) called at [/home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php:38]

An error occurred in script '/home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php' on line 39: Division by zero
Array
(
    [_GET] => Array
        (
        )

    [_POST] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [_FILES] => Array
        (
        )

    [_SERVER] => Array
        (
            [LSPHP_ENABLE_USER_INI] => on
            [PATH] => /usr/local/bin:/usr/bin:/bin
            [TEMP] => /tmp
            [TMP] => /tmp
            [TMPDIR] => /tmp
            [PWD] => /
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [CONTENT_LENGTH] => 0
            [HTTP_HOST] => shopgi.com
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [UNIQUE_ID] => aMsD2yf6gLy8xllkVNLKEwAAEzA
            [SCRIPT_URL] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [SCRIPT_URI] => https://shopgi.com/garyjeurink/addons/0-php2/ch07/handle_errors.php
            [USER_ID] => 5489533
            [HTTPS] => on
            [SSL_TLS_SNI] => shopgi.com
            [HTTP2] => on
            [H2PUSH] => off
            [H2_PUSH] => off
            [H2_PUSHED] => 
            [H2_PUSHED_ON] => 
            [H2_STREAM_ID] => 63
            [H2_STREAM_TAG] => 2640893-164-63
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SERVER_NAME] => shopgi.com
            [SERVER_ADDR] => 160.153.44.64
            [SERVER_PORT] => 443
            [REMOTE_ADDR] => 216.73.216.168
            [DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html
            [REQUEST_SCHEME] => https
            [CONTEXT_PREFIX] => 
            [CONTEXT_DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html
            [SERVER_ADMIN] => webmaster@shopgi.com
            [SCRIPT_FILENAME] => /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php
            [REMOTE_PORT] => 59370
            [SERVER_PROTOCOL] => HTTP/2.0
            [REQUEST_METHOD] => GET
            [QUERY_STRING] => 
            [REQUEST_URI] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [SCRIPT_NAME] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [PHP_SELF] => /garyjeurink/addons/0-php2/ch07/handle_errors.php
            [REQUEST_TIME_FLOAT] => 1758135259.8298
            [REQUEST_TIME] => 1758135259
        )

)

#0  my_error_handler(2, Division by zero, /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php, 39, Array ([_GET] => Array (),[_POST] => Array (),[_COOKIE] => Array (),[_FILES] => Array (),[_SERVER] => Array ([LSPHP_ENABLE_USER_INI] => on,[PATH] => /usr/local/bin:/usr/bin:/bin,[TEMP] => /tmp,[TMP] => /tmp,[TMPDIR] => /tmp,[PWD] => /,[HTTP_ACCEPT] => */*,[HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate,[CONTENT_LENGTH] => 0,[HTTP_HOST] => shopgi.com,[HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com),[HTTP_X_HTTPS] => 1,[UNIQUE_ID] => aMsD2yf6gLy8xllkVNLKEwAAEzA,[SCRIPT_URL] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[SCRIPT_URI] => https://shopgi.com/garyjeurink/addons/0-php2/ch07/handle_errors.php,[USER_ID] => 5489533,[HTTPS] => on,[SSL_TLS_SNI] => shopgi.com,[HTTP2] => on,[H2PUSH] => off,[H2_PUSH] => off,[H2_PUSHED] => ,[H2_PUSHED_ON] => ,[H2_STREAM_ID] => 63,[H2_STREAM_TAG] => 2640893-164-63,[SERVER_SIGNATURE] => ,[SERVER_SOFTWARE] => Apache,[SERVER_NAME] => shopgi.com,[SERVER_ADDR] => 160.153.44.64,[SERVER_PORT] => 443,[REMOTE_ADDR] => 216.73.216.168,[DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html,[REQUEST_SCHEME] => https,[CONTEXT_PREFIX] => ,[CONTEXT_DOCUMENT_ROOT] => /home/c8jndex3nms3/public_html,[SERVER_ADMIN] => webmaster@shopgi.com,[SCRIPT_FILENAME] => /home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php,[REMOTE_PORT] => 59370,[SERVER_PROTOCOL] => HTTP/2.0,[REQUEST_METHOD] => GET,[QUERY_STRING] => ,[REQUEST_URI] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[SCRIPT_NAME] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[PHP_SELF] => /garyjeurink/addons/0-php2/ch07/handle_errors.php,[REQUEST_TIME_FLOAT] => 1758135259.8298,[REQUEST_TIME] => 1758135259))) called at [/home/c8jndex3nms3/public_html/garyjeurink/addons/0-php2/ch07/handle_errors.php:39]