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

  • Home
  • SEARCH
  • 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 8084765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:53:40+00:00 2026-06-05T17:53:40+00:00

I have the following; $foo; $foo = serialize($foo); print_r($foo); it gave me a result

  • 0

I have the following;

$foo;
$foo  = serialize($foo);
print_r($foo);

it gave me a result of N;

Now I do not know if this is unique to the system i am using or if this is a normal result. All I know is it was causing major problems with my site.

My question is… is this normal when serializing an undefined variable?If so can someone please explain why it outputs this result.Thank you for your time.

  • 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-05T17:53:42+00:00Added an answer on June 5, 2026 at 5:53 pm

    It appears that the string N; is the serialize()d form of null. (See this codepad)
    However, two things to note:

    1. You should be defining all variables before using them, even if you just declare them as null. Otherwise you’ll get a notice about $foo being an undefined variable. Some argue that you can hide warnings, but this is poor practice. You should prevent them completely by using sensible defaults for all variables.
    2. Typically, one does not need to read the output of serialize(). You can store it on a DB, in a file, or in a memory cache system like Memcached, APC, or Redis. However, you will never need to understand what the output of serialize() means thanks to unserialize().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following regex: foo = Regex.Replace(foo, @[^a-zA-Z0-9\s-], ); Currently, this removes Unicode
Suppose I have the following snipplet: Foo foo; .... return bar(); Now, does the
Say I have the following: $('#foo') I'd like to know if that selector matches
I am serializing objects to XML using System.Xml.Serialization and this requires me to have
Say I have the following function: foo <- function(x, y = min(m)) { m
Suppose you have the following function foo . When I'm running a for loop,
Let's say we have the following function: foo <- function(x) { line1 <- x
I have the following code: class Foo<T> where T : struct { private T
I have the following code: void foo() { vector<double> v(100,1); // line 1 //
Say I have the following class: class Foo { // ctor etc here public

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.