Локальный комьютер: PHP 7.1.28
Выдает:Error [8] in [/home/vagrant/code/ch11q1.php] at line [7]: '[Undefined variable: a]'
4fh8vu9mo536cps459am7h9c64
Online PHP editor (https://3v4l.org/poDFC): PHP 7.1.28
Выдает:Error [8] in [/in/poDFC] at line [7]: '[Undefined variable: a]'
Error [2] in [/in/poDFC] at line [8]: '[session_start(): Cannot send session cookie - headers already sent by (output started at /in/poDFC:3)]'
Error [2] in [/in/poDFC] at line [8]: '[session_start(): Cannot send session cache limiter - headers already sent (output started at /in/poDFC:3)]'
25578025135a08b4098d16d73c849820
Сам код:<?php
$handler = function($errorNumber, $errorMessage, $file, $line) {
echo "Error [$errorNumber] in [$file] at line [$line]: '[$errorMessage]'\r\n";
};
set_error_handler($handler);
try {
echo $a;
session_start();
echo session_id();
} catch (Throwable $e) {
echo "Error caught!";
}
P.S.: Этот код из книги
PHP 7 Zend Certification Study Guide.
UPD #1: Этот URL тоже из книги:
https://3v4l.org/poDFC