I'm not sure bitmask is the right term. Let me explain:
In php, the error_reporting function can be called in several ways:
// Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE);
I got the term bitmask from php.net page here
Anyway, this is what I implemented a SIMPLE method called ls that returns the contents of a directory.
This function takes 3 arguments ... ($ include_hidden = false, $ return_absolute = false, $ ext = false)
Therefore, when I call a function, I set how I need the results. I want the results to return hidden directories, do I want only base names, etc.
so when i call the function i write
ls(true, false, true) ls(false, false, true) ls(true, true, true) etc...
I thought it would be much more readable if I could just indicate how I want to return the data?
so something like:
ls( INCLUDE_HIDDEN | HIDE_EXTS ); ls( SHOW_ABSOLUTE_PATHS | HIDE_EXTS );
etc...
How do I implement this in terms of testing, which flags were called?
php bitmask
AlexMorley-Finch Aug 09 2018-12-12T00: 00Z
source share