W3cubDocs

/CakePHP 4.4

Class PhpError

Object wrapper around PHP errors that are emitted by trigger_error()

Namespace: Cake\Error

Method Summary

Method Detail

__construct() public

__construct(int $code, string $message, string|null $file = null, int|null $line = null, array $trace = [])

Constructor

Parameters

int $code

The PHP error code constant

string $message

The error message.

string|null $file optional

The filename of the error.

int|null $line optional

The line number for the error.

array $trace optional

The backtrace for the error.

getCode() public

getCode(): int

Get the PHP error constant.

Returns

int

getFile() public

getFile(): string|null

Get the error file

Returns

string|null

getLabel() public

getLabel(): string

Get the error code label

Returns

string

getLine() public

getLine(): int|null

Get the error line number.

Returns

int|null

getLogLevel() public

getLogLevel(): int

Get the mapped LOG_ constant.

Returns

int

getMessage() public

getMessage(): string

Get the error message.

Returns

string

getTrace() public

getTrace(): array

Get the stacktrace as an array.

Returns

array

getTraceAsString() public

getTraceAsString(): string

Get the stacktrace as a string.

Returns

string

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Error.PhpError.html