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 8622695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:07:12+00:00 2026-06-12T07:07:12+00:00

I was looking through the WordPress core, and I found this function: function unserialize

  • 0

I was looking through the WordPress core, and I found this function:

function unserialize ( $data ) {
    return unserialize( $data );
}

First off, I don’t even understand why unserialize has been defined since its a native php function. Secondly, what in the world is going on here since its defined recursively without any condition to halt infinite recursion?

Throw me a bone. I’m newbie at this stuff.

  • 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-12T07:07:13+00:00Added an answer on June 12, 2026 at 7:07 am

    That’s got to be method definition in a class, eg:

    class SomeClass
    {
        function unserialize($data) 
        { 
            return unserialize($data);
        }
    
        // ...
    }
    

    Otherwise you’d get a fatal error saying that you can’t redeclare unserialize().

    All it does is add an unserialize() method to a class. This method then calls the native unserialize() function in PHP. Seems rather silly, but then, I didn’t write WordPress.


    I believe I found the method in question: wp-includes/rss.php (line 783). And it’s indeed a method of the RSSCache class.

    I suppose it’s possible they might want to write their own serialization routine in the future and/or some subclass of RSSCache has its own serialize() and unserialize().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I have gone through this link http://codex.wordpress.org/Integrating_WordPress_with_Your_Website . I cannot use this.
Been looking through other answers and I still don't understand the modulo for negative
While looking through some old code I came across this gem: MyObject o =
I just received my first approval for a Wordpress Plugin. I'm am looking for
Looking through some java code and this just does not seem right. To me,
So I've been looking through how to get this to work and haven't been
This is my first time using Pods in Wordpress, so forgive me if this
Looking through Backbones source I noticed that classes are defined like this: var Model
Looking through multiple iOS crash logs, I'm finding stack traces which are near identical
Looking through decimal.py , it uses NotImplemented in many special methods. e.g. class A(object):

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.