Rust

system

Module

Process and host functions.

Contents

use php_std::system::gethostname;
Rust
pub fn gethostname() -> String

PHP gethostname(): the kernel's node name.

use php_std::system::getmypid;
Rust
pub fn getmypid() -> u32

PHP getmypid().

use php_std::system::uniqid;
Rust
pub fn uniqid(prefix: &str, more_entropy: bool) -> String

PHP uniqid($prefix, $more_entropy): seconds and microseconds in hex (%08x%05x), plus %.8F of a random value in [0, 10) with more entropy.

Without more entropy, like PHP, two calls never return the same value in one process: a call in the same microsecond as the previous one waits for the clock to move on.