SplFileInfo::isExecutable

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::isExecutableTells if the file is executable

Beschreibung

publicSplFileInfo::isExecutable(): bool

Checks if the file is executable.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns true if executable, false otherwise.

Beispiele

Beispiel #1 SplFileInfo::isExecutable() example

<?php
$info
= new SplFileInfo('/usr/bin/php');
var_dump($info->isExecutable());

$info = new SplFileInfo('/usr/bin');
var_dump($info->isExecutable());

$info = new SplFileInfo('foo');
var_dump($info->isExecutable());
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

bool(true) bool(true) bool(false)
To Top