top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How __sleep and __wakeup functions work in PHP?

0 votes
429 views
How __sleep and __wakeup functions work in PHP?
posted Jun 18, 2014 by Sachin Dahda

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Sleep function returns the array of all the variables which need to be saved, whereas wakeup function retrieves them.

answer Jun 18, 2014 by Karamjeet Singh
Similar Questions
+1 vote

This works -

$out = system("ls -l ",$retvals);
printf("%s", $out);

This does -

echo exec("ls -l");

This does not -

if( !file_exists("/var/www/orders.txt"));
{
 $out = system("touch /var/www/orders.txt", $ret);
 $out2 = system("chmod 766 /var/www/orders.txt", $ret);
 echo 'file2
';
 echo file_exists("/var/www/orders.txt");
}

and this does not -

if( !file_exists("/var/www/orders.txt"));
{
 exec("touch /var/www/orders.txt");
 exec("chmod 766 /var/www/orders.txt");
 echo 'file2
';
 echo file_exists("/var/www/orders.txt");
}
...