Why did the PHP variable suddenly disappear?

Source: Internet
Author: User
Tags apache download
I encountered a particularly strange problem, using post to get a table only son pass the data, and assign it to a variable, this variable is just acquired with echo printing is no problem, can be displayed normally. But in the process of function execution actually disappeared!!!
It was thought that the process of variable conversion did not write to the cause, but the look is not, especially the strange point is:
There is no problem with echo printing this variable before I use the Strtotime function! Direct echo Strtotime ($time); no problem, but when I performed $time=strtotime ($time), then echo print again found to be empty!!! Empty of!!!

PS: Before also encountered a very magical thing, controller data has been correctly passed to the front page, but is not displayed, as long as I am in the controller print_r ($res); print this array when the page corresponding to the location, it can actually show!!!
Is this a ecshop bug? Or what? The great God pointed out!


Reply to discussion (solution)

Post your code to see ...

This, is not your post value has not come over ah? You re-submit the form and try again!

Post your code to see ...


 Set_charset ("UTF8"), if (Mysqli_connect_errno ()) {echo ' error:could not connect to database. Please try again later. '; Exit;} if ($act = = ' Add ') {$sql = "INSERT into Ecs_partners (partners, StartTime, Endtime, Sort_order)". "Values ('". $partners. "'," . $starttime. ",". $endtime. ",". $sort _order. ")"; ElseIf ($act = = ' edit ') {$sql = "update ecs_partners set partners= '". $partners. "', starttime=". $starttime. ", Endtime=". $ Endtime. ", sort_order=". $sort _order. "Where id=". $id; $res = $db->query ($sql), if ($res) {echo "inserted successfully, jumped after 3 seconds?
"; echo" or??? Direct jump? "; /header ("Location:partners.php?act=list"); header ("Refresh:3; Url=partners.php?act=list ");} Else{echo "Insert?? It's a little heavy.
"echo" or?? Return to the Lord's face ";} $db->close ();}? >

Post your code to see ...


Yes, I have tried, did the test, the front has the output, is through the $endtime=strtotime ($endtime); This step after the discovery value incredibly empty, baffled it, do not know what the reason

Post your code to see ...

Forget to say, time because with JS judgment processing, so I passed directly

$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??

$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??


The pass is a formatted time string: 2015-09-05,echo out is the converted timestamp, which can be output normally.
The key is that the assignment statement is empty when you print the variable.


$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??


The pass is a formatted time string: 2015-09-05,echo out is the converted timestamp, which can be output normally.
The key is that the assignment statement is empty when you print the variable.

I use your word test on my computer, the result is normal, no landlord said the problem ... It's weird--empty means null?



$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??


The pass is a formatted time string: 2015-09-05,echo out is the converted timestamp, which can be output normally.
The key is that the assignment statement is empty when you print the variable.

I use your word test on my computer, the result is normal, no landlord said the problem ... It's weird--empty means null?


NN, in addition I tried again, found that Var_dump (Strtotime ($endtime)) became bool (false)



$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??


The pass is a formatted time string: 2015-09-05,echo out is the converted timestamp, which can be output normally.
The key is that the assignment statement is empty when you print the variable.

I use your word test on my computer, the result is normal, no landlord said the problem ... It's weird--empty means null?


This kind of thing is too strange, the text also expresses unclear, I try to find other classmates

Don't understand ... Ai Moderator to see ...




$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??


The pass is a formatted time string: 2015-09-05,echo out is the converted timestamp, which can be output normally.
The key is that the assignment statement is empty when you print the variable.

I use your word test on my computer, the result is normal, no landlord said the problem ... It's weird--empty means null?


NN, in addition I tried again, found that Var_dump (Strtotime ($endtime)) became bool (false)


Var_dump should not be $endtime1, you dump $endtime variable at this time there is no positive output false, you are not the variable name messed up?



$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??


The pass is a formatted time string: 2015-09-05,echo out is the converted timestamp, which can be output normally.
The key is that the assignment statement is empty when you print the variable.

I use your word test on my computer, the result is normal, no landlord said the problem ... It's weird--empty means null?


Days, I directly use string Var_dump (Strtotime (' 2070-01-01 ')) output is actually false




$endtime = Strtotime ($endtime 1);
For the Strtotime function: Returns a timestamp if successful, otherwise FALSE
What is the value of your $endtime1?? What is Echo strtotime ($endtime 1)??


The pass is a formatted time string: 2015-09-05,echo out is the converted timestamp, which can be output normally.
The key is that the assignment statement is empty when you print the variable.

I use your word test on my computer, the result is normal, no landlord said the problem ... It's weird--empty means null?


NN, in addition I tried again, found that Var_dump (Strtotime ($endtime)) became bool (false)


Var_dump should not be $endtime1, you dump $endtime variable at this time there is no positive output false, you are not the variable name messed up?


Sorry, I changed the name again. Will this be related to the PHP version? I converted print to 2010-01-01 when the output timestamp is normal, but more than 40 of all false, php5.6.11

This is the problem with the strtotime scope of application.
The manual has:

Infer that Strtotime cannot process a date after 2069
It's a matter for children and grandchildren, not for you to worry about.

Is that what happened?

This is the problem with the strtotime scope of application.
The manual has:

Infer that Strtotime cannot process a date after 2069
It's a matter for children and grandchildren, not for you to worry about.

Yes, I've confirmed it with my classmate's computer.

Is that what happened?

What do you mean?


This is the problem with the strtotime scope of application.
The manual has:

Infer that Strtotime cannot process a date after 2069
It's a matter for children and grandchildren, not for you to worry about.

Yes, I've confirmed it with my classmate's computer.

You mean, your classmates can strtotime print out the timestamp after 2,070 years??



This is the problem with the strtotime scope of application.
The manual has:

Infer that Strtotime cannot process a date after 2069
It's a matter for children and grandchildren, not for you to worry about.

Yes, I've confirmed it with my classmate's computer.

You mean, your classmates can strtotime print out the timestamp after 2,070 years??


NN, 2080 can also, and I alone set up a new file directly with Strtotime print 2070 No, so I think there might be a problem with PHP

See the reply, feel very magical appearance ~




This is the problem with the strtotime scope of application.
The manual has:

Infer that Strtotime cannot process a date after 2069
It's a matter for children and grandchildren, not for you to worry about.

Yes, I've confirmed it with my classmate's computer.

You mean, your classmates can strtotime print out the timestamp after 2,070 years??


NN, 2080 can also, and I alone set up a new file directly with Strtotime print 2070 No, so I think there might be a problem with PHP

There may be a problem with the version or PHP configuration. Under normal circumstances should be like your classmates can print normally, the variable will not be lost.





This is the problem with the strtotime scope of application.
The manual has:

Infer that Strtotime cannot process a date after 2069
It's a matter for children and grandchildren, not for you to worry about.

Yes, I've confirmed it with my classmate's computer.

You mean, your classmates can strtotime print out the timestamp after 2,070 years??


NN, 2080 can also, and I alone set up a new file directly with Strtotime print 2070 No, so I think there might be a problem with PHP

There may be a problem with the version or PHP configuration. Under normal circumstances should be like your classmates can print normally, the variable will not be lost.



Maybe, I am the environment that I set up, change the place is very few, estimate what module does not open.
Ps: I do not know if you have used php5.6.12, this version I tried on several computers, found that there is no curl in phpinfo any information, only show the author name

y2k38 Vulnerability

Y2k38, also known as the Unix Millennium Bug, will affect all 32-bit systems using a UNIX timestamp integer to record the time of PHP, and other programming languages. The maximum time a variable of an integral type can be saved is January 2038
19th 03:14:07. After this time, the integer value will overflow. From January 01, 1970 onwards, to world standard January 19, 2038 Tuesday 03:14:07 more than 2^31? 1. 2^31? 1 is
0x7FFFFFFF, I believe many programmers have seen, in 32-bit systems, this represents the largest signed integer. If it is used to represent the number of seconds, it is probably equivalent to 68.1 years, which is exactly the number from 1970 to 2038.

Will the 64-bit system be affected?

Theoretically not, it is strongly recommended to test it. The date that can be saved under a 64-bit system is 21 times times the current age of the universe-29.2 billion years.

I am also a 64-bit system, but I found that there is a problem, but I see the next Apache is 32, so not only 64-bit system is OK, Apache also 64-bit can be avoided

So the 32-bit machine solves
PHP introduced a DateTime class starting from version 5.2 (in 5.1, the experiment was added, and some methods were expanded in version 5.3).
is not 64 Apache can solve the problem I am not sure, I am also looking for 64 Apache download, not yet find out, we try together.
Well, should there be 64 Apache? Oh

y2k38 Vulnerability

Y2k38, also known as the Unix Millennium Bug, will affect all 32-bit systems using a UNIX timestamp integer to record the time of PHP, and other programming languages. The maximum time a variable of an integral type can be saved is January 2038
19th 03:14:07. After this time, the integer value will overflow. From January 01, 1970 onwards, to world standard January 19, 2038 Tuesday 03:14:07 more than 2^31? 1. 2^31? 1 is
0x7FFFFFFF, I believe many programmers have seen, in 32-bit systems, this represents the largest signed integer. If it is used to represent the number of seconds, it is probably equivalent to 68.1 years, which is exactly the number from 1970 to 2038.

Will the 64-bit system be affected?

Theoretically not, it is strongly recommended to test it. The date that can be saved under a 64-bit system is 21 times times the current age of the universe-29.2 billion years.

I am also a 64-bit system, but I found that there is a problem, but I see the next Apache is 32, so not only 64-bit system is OK, Apache also 64-bit can be avoided


All I've chosen is a 64-bit.

You try Echo strtotime (' 2038/01/19 11:14:08 '); and Echo strtotime (' 2038/01/19 11:14:07 '), is not 07 can be output, 08 can't, overflow problem is affirmative, but is not Win64 bit system can solve, I have not tested successfully! But I think the Linux 64 bit should be no problem.

Seems theoretically not, not the actual situation will not, I Win64 bit, the software is also 64 bit is not, you say your friend is OK, you can ask him PHP version, see is not the latest on no problem, my PHP is 5.5.15

You try Echo strtotime (' 2038/01/19 11:14:08 '); and Echo strtotime (' 2038/01/19 11:14:07 '), is not 07 can be output, 08 can't, overflow problem is affirmative, but is not Win64 bit system can solve, I have not tested successfully! But I think the Linux 64 bit should be no problem.


Try, exactly what you think, 08 blank.


You try Echo strtotime (' 2038/01/19 11:14:08 '); and Echo strtotime (' 2038/01/19 11:14:07 '), is not 07 can be output, 08 can't, overflow problem is affirmative, but is not Win64 bit system can solve, I have not tested successfully! But I think the Linux 64 bit should be no problem.


Try, exactly what you think, 08 blank.


Besides, I'm using Win7 64bit.



You try Echo strtotime (' 2038/01/19 11:14:08 '); and Echo strtotime (' 2038/01/19 11:14:07 '), is not 07 can be output, 08 can't, overflow problem is affirmative, but is not Win64 bit system can solve, I have not tested successfully! But I think the Linux 64 bit should be no problem.


Try, exactly what you think, 08 blank.


Besides, I'm using Win7 64bit.



In the Windows environment, PHP6 the following version, is not supported 64-bit, this PHP official has confirmed the problem, because the PHP5 version of Windows is a beta version, there is no official version, this can be found on the official website.

Simply put, in the Windows environment, PHP5 's intval is only supported to 2147483647, that is, only 32-bit, even if your system, WebServer, PHP are 64-bit version, and only support 32-bit

Read online Some people say that 64-bit PHP is still 32-bit mode, only Linux or win 64-bit PHP7 is the use of 64-bit mode, I am in the next php7, see if I can solve.

With a 64-bit Linux version of PHP, there's no problem.

With a 64-bit Linux version of PHP, there's no problem.


Own source of the way to build CENTOS+NGINX+PHP+MARIADB server failed many times, has been a great injury


With a 64-bit Linux version of PHP, there's no problem.


Own source of the way to build CENTOS+NGINX+PHP+MARIADB server failed many times, has been a great injury



The vitality is hurt, also must continue to try,
Because of the environmental deployment and troubleshooting requirements, regardless of the size of the company, RD can take at least half of the operation,
and the production environment of PHP, I have not seen the use of Windows

After testing, PHP7 can solve this problem, but PHP7 is not officially released. There are no other bug problems to know.



With a 64-bit Linux version of PHP, there's no problem.


Own source of the way to build CENTOS+NGINX+PHP+MARIADB server failed many times, has been a great injury



The vitality is hurt, also must continue to try,
Because of the environmental deployment and troubleshooting requirements, regardless of the size of the company, RD can take at least half of the operation,
and the production environment of PHP, I have not seen the use of Windows



After testing, PHP7 can solve this problem, but PHP7 is not officially released. There are no other bug problems to know.



Thanks a lot, I'll send my classmate's PHP version later.

Thank you, thank you.

Sorry, I was wrong, my classmates use centos5.4,64 bit of

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.