Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:57:25+00:00 2026-06-04T19:57:25+00:00

uuid_create requires the parameter to be passed by reference. uuid_create(&$foo); The problem is that

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:57:26+00:00Added an answer on June 4, 2026 at 7:57 pm

    PHP does not have a method uuid_create and 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:

    function uuid4() {
        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
            // 32 bits for "time_low"
            mt_rand(0, 0xffff), mt_rand(0, 0xffff),
    
            // 16 bits for "time_mid"
            mt_rand(0, 0xffff),
    
            // 16 bits for "time_hi_and_version",
            // four most significant bits holds version number 4
            mt_rand(0, 0x0fff) | 0x4000,
    
            // 16 bits, 8 bits for "clk_seq_hi_res",
            // 8 bits for "clk_seq_low",
            // two most significant bits holds zero and one for variant DCE1.1
            mt_rand(0, 0x3fff) | 0x8000,
    
            // 48 bits for "node"
            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table called users This table has two columns (that are
I'm looking for a RAIL way to create a very secure UID that will
Here is the string : Usage: xp (UUID: 30503c82-bf04-4f75-ab8f-129b8b350487) I want to grep this
Is there a block of Java UUID that won't automatically generated? I would like
I'm looking for a UUID library for programming in C, that has a reasonable
I have this table layout: uuid bigint(20) unsigned primary auto_increment timestamp int(11) unsigned name
I am Using Boost Random generator to generate Random UUID's.The Random UUID that i
I am new to NodeJS so this is probably an easy fix. However I
How would this INSERT statement be rewritten without the subquery, so it no longer
I need to create an application, where GAE server will always talk with just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.