mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
added nullsafe function, time should be set instantly after player joined, some php8 fixes
This commit is contained in:
parent
695f9f1484
commit
a66176b75d
5 changed files with 41 additions and 22 deletions
|
|
@ -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 . "/");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue