uuid_create requires the parameter to be passed by reference.
uuid_create(&$foo);
The problem is that this will produce error:
Message: Call-time pass-by-reference has been deprecated
Is the PHP extension uuid-php.x86_64 outdated? It is not “compatible” with the PHP 5. What are the alternatives?
Just wantend to highlight that this is not a duplicate.
$foo = NULL;
uuid_create($foo);
Will produce:
Type: Run-time warnings (non-fatal error).
Message: uuid_create(): uuid_create: parameter wasn't passed by reference
PHP does not have a method
uuid_createand it’s not mentioned in the docs so if it comes from an extension it’s most likely not an official one and probably outdated. The fact that the function expects an out parameter instead of returning the value is already a pretty obvious sign that the function is rather bad.However, writing PHP code to generate an uuid4 is pretty easy as it uses random values for all its fields, i.e. you do not need to access system-specific things such a the MAC address: