posix_mknod
Function • Params and return types changed in PHP 8.0
Create a special or ordinary file (POSIX.1).
posix_mknod Function synopsis
posix_mknod(
string $filename,
int $flags,
int $major = 0,
int $minor = 0
): bool
Parameters
$filename
Typestring
The file to create
$flags
Typeint
This parameter is constructed by a bitwise OR between file type (one of
the following constants: POSIX_S_IFREG,
POSIX_S_IFCHR, POSIX_S_IFBLK,
POSIX_S_IFIFO or
POSIX_S_IFSOCK) and permissions.
$flags accepts one of the following constant values:
$major
OptionalTypeintDefault value0
The major device kernel identifier (required to pass when using
S_IFCHR or S_IFBLK).
$minor
OptionalTypeintDefault value0
The minor device kernel identifier.
Return value
Typebool
Returns true on success, false on failure
Changes to the posix_mknod Function
PHP 8.0
- Return type added:
bool - Parameter name of parameter #1 changed:
$pathnameto$filename - Parameter type added for parameter #1 (
$filename):string - Parameter name of parameter #2 changed:
$modeto$flags - Parameter type added for parameter #2 (
$flags):int - Parameter type added for parameter #3 (
$major):int - Parameter default value added for position #3 (
$major):0 - Parameter type added for parameter #4 (
$minor):int - Parameter default value added for position #4 (
$minor):0
posix_mknod(
- $pathname,
+ string $filename,
- $mode,
+ int $flags,
- $major,
+ int $major = 0,
- $minor
+ int $minor = 0
- )
+ ): bool posix_mknod Function Availability
posix_mknod Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | Yes |
| PHP 7.0Unsupported | Yes |
| PHP 5.6Unsupported | Yes |
| PHP 5.5Unsupported | Yes |
| PHP 5.4Unsupported | Yes |
| PHP 5.3Unsupported | Yes |