<?php declare(strict_types = 1);
class bar {
public const FLAG = 0b0010;
public static function foo(string $v, int $flags) {
if ((($flags & self::FLAG) && !isset($v[0]))) {
return true;
}
return false;
}
}
var_dump(bar::foo('', 0b0010));
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
bool(true)
Output for 5.6.38
Warning: Unsupported declare 'strict_types' in /in/72d5f on line 1
Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /in/72d5f on line 4
Process exited with code 255.