|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-04-30 01:26 UTC] felipe@php.net
-Status: Open
+Status: Feedback
[2010-04-30 01:26 UTC] felipe@php.net
[2010-05-01 15:31 UTC] peter dot dishman at telephoneticsvip dot co dot uk
-Status: Feedback
+Status: Open
[2010-05-01 15:31 UTC] peter dot dishman at telephoneticsvip dot co dot uk
[2010-06-18 15:23 UTC] peter dot dishman at telephoneticsvip dot co dot uk
-Status: Open
+Status: Closed
[2010-06-18 15:23 UTC] peter dot dishman at telephoneticsvip dot co dot uk
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 20:00:01 2025 UTC |
Description: ------------ Prior to v5.2.10 you could call userland functions in the magic method __sleep(). Now in 5.2.10, .11, .12 and .13 I just get a fatal error undefined function when I try to do so. I've tested this in 5.3.2 and it works correctly as it does in 5.2.9 and before. This is running on the standard 5.2.13 TS VS6 build and my session configuration is: [Session] session.save_handler = files session.save_path = "c:/php/tmp" session.use_cookies = 1 session.use_only_cookies = 1 session.name = sID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.cookie_httponly = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 1000 session.gc_maxlifetime = 9000 session.bug_compat_42 = 0 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 5 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=,iframe=src" Test script: --------------- <?php function inc ($foo) { return ($foo + 1); } class foo { function __construct() { $this->bar = 0; } function __sleep() { $this->bar = inc($this->bar); return array('bar'); } public $bar; } session_start(); if (!isset($_SESSION['foo'])) { $_SESSION['foo'] = new foo(); } $foo = $_SESSION['foo']; echo "foo->bar = ".$foo->bar."<br>"; ?> Expected result: ---------------- As you refresh the page given by the script, you should just see the number increment each time with no errors generated. Actual result: -------------- In 5.2.13, after refreshing the page you get: Fatal error: Call to undefined function inc() in C:\test\sleeptest.php on line 12 This worked correctly in 5.2.9 and before, and also works in 5.3.2