Bug #51630 [Opn->Csd]: Can't call userland functions from __sleep()
Edit report at http://bugs.php.net/bug.php?id=51630&edit=1 ID: 51630 User updated by: peter dot dishman at telephoneticsvip dot co dot uk Reported by: peter dot dishman at telephoneticsvip dot co dot uk Summary: Can't call userland functions from __sleep() -Status: Open +Status: Closed Type: Bug Package: Session related Operating System: Windows XP SP2 PHP Version: 5.2.13 New Comment: I've tried this again, and it appears to be caused by apc. If I disable apc, the problem goes away. I'm not on the latest version of apc so am closing this bug. Previous Comments: [2010-05-01 15:31:39] peter dot dishman at telephoneticsvip dot co dot uk There don't seem to be any snapshots available at that windows url? [2010-04-30 01:26:53] fel...@php.net Please try using this snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ I cannot reproduce it on 5.2.14-dev. ---- [2010-04-22 10:49:03] peter dot dishman at telephoneticsvip dot co dot uk 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: --- 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.""; ?> 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 -- Edit this bug report at http://bugs.php.net/bug.php?id=51630&edit=1
Bug #51630 [Fbk->Opn]: Can't call userland functions from __sleep()
Edit report at http://bugs.php.net/bug.php?id=51630&edit=1 ID: 51630 User updated by: peter dot dishman at telephoneticsvip dot co dot uk Reported by: peter dot dishman at telephoneticsvip dot co dot uk Summary: Can't call userland functions from __sleep() -Status: Feedback +Status: Open Type: Bug Package: Session related Operating System: Windows XP SP2 PHP Version: 5.2.13 New Comment: There don't seem to be any snapshots available at that windows url? Previous Comments: [2010-04-30 01:26:53] fel...@php.net Please try using this snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ I cannot reproduce it on 5.2.14-dev. [2010-04-22 10:49:03] peter dot dishman at telephoneticsvip dot co dot uk 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: --- 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.""; ?> 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 -- Edit this bug report at http://bugs.php.net/bug.php?id=51630&edit=1
[PHP-BUG] Bug #51630 [NEW]: Can't call userland functions from __sleep()
From: Operating system: Windows XP SP2 PHP version: 5.2.13 Package: Session related Bug Type: Bug Bug description:Can't call userland functions from __sleep() 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: --- 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.""; ?> 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 -- Edit bug report at http://bugs.php.net/bug.php?id=51630&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51630&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51630&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51630&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51630&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51630&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51630&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51630&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51630&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51630&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51630&r=support Expected behavior: http://bugs.php.net/fix.php?id=51630&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51630&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51630&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51630&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51630&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=51630&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51630&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51630&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51630&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51630&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51630&r=mysqlcfg