GoLang SplFileObject::getFlags

request it (366)
GoLang replacement for PHP's SplFileObject::getFlags [edit | history]



Do you know a GoLang replacement for PHP's SplFileObject::getFlags? Write it!

PHP SplFileObject::getFlags

PHP original manual for SplFileObject::getFlags [ show | php.net ]

SplFileObject::getFlags

(PHP 5 >= 5.1.0, PHP 7)

SplFileObject::getFlagsGets flags for the SplFileObject

Description

public int SplFileObject::getFlags ( void )

Gets the flags set for an instance of SplFileObject as an integer.

Parameters

This function has no parameters.

Return Values

Returns an integer representing the flags.

Examples

Example #1 SplFileObject::getFlags() example

<?php
$file 
= new SplFileObject(__FILE__"r");

if (
$file->getFlags() & SplFileObject::SKIP_EMPTY) {
    echo 
"Skipping empty lines\n";
} else {
    echo 
"Not skipping empty lines\n";
}

$file->setFlags(SplFileObject::SKIP_EMPTY);

if (
$file->getFlags() & SplFileObject::SKIP_EMPTY) {
    echo 
"Skipping empty lines\n";
} else {
    echo 
"Not skipping empty lines\n";
}
?>

The above example will output something similar to:

Not skipping empty lines
Skipping empty lines

See Also