added nullsafe function, time should be set instantly after player joined, some php8 fixes

This commit is contained in:
GameHerobrine 2023-01-30 17:20:23 +03:00
parent 695f9f1484
commit a66176b75d
5 changed files with 41 additions and 22 deletions

View file

@ -61,6 +61,22 @@ function kill($pid){
}
}
if(version_compare(PHP_VERSION, '7.0.0') >= 0){ //php > 7.0
eval('
function nullsafe(&$a, $null){
return $a ?? $null;
}
');
}else{
eval('
function nullsafe(&$value, $null){
return isset($value) ? $value : $null;
}
'); //behavior will change if you replace ' with ".
}
function require_all($path, &$count = 0){
$dir = dir($path . "/");