Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

posix_get_last_error

Description

The posix_get_last_error of POSIX for PHP retrieves the error number set by the last posix function that failed.

Syntax

posix_get_last_error(): int

Return

Returns the errno (error number) set by the last posix function that failed. If no errors exist, 0 is returned.

Examples

1 · void · 0

<?php

$return = posix_get_last_error();

echo $return;

0

2 · void · 1

<?php

$process_id = 100;
$signal = SIGKILL;

posix_kill($process_id, $signal);

$return = posix_get_last_error();

echo $return;

1

3 · void · 3

<?php

$process_id = 100000;
$signal = SIGKILL;

posix_kill($process_id, $signal);

$return = posix_get_last_error();

echo $return;

3

4 · void · 13

<?php

$filename = $_SERVER['DOCUMENT_ROOT'] . '/assets/txt/1.txt';
$flags = POSIX_X_OK;

posix_access($filename, $flags);

$return = posix_get_last_error();

echo $return;

13
HomeMenu