|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2012-11-21 03:07 UTC] laruence@php.net
 
-Assigned To:
+Assigned To: krakjoe
  [2012-11-23 15:53 UTC] krakjoe@php.net
 
-Status: Assigned
+Status: Not a bug
  [2012-11-23 15:53 UTC] krakjoe@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
Description: ------------ #0 0x083afc55 in zend_std_object_get_class (object=0x9f5ca88, tsrm_ls=0xb772b600) at /home/php-5.4.8/Zend/zend_object_handlers.c:1450 1450 { (gdb) bt #0 0x083afc55 in zend_std_object_get_class (object=0x9f5ca88, tsrm_ls=0xb772b600) at /home/php-5.4.8/Zend/zend_object_handlers.c:1450 #1 0x082f90c1 in php_var_serialize (buf=0x9fc3150, struc=0xb6d30f3c, var_hash=0xb6d30f38, tsrm_ls=0x9f5ca88) at /home/php-5.4.8/ext/standard/var.c:899 #2 0xb6d3a03e in pthreads_store_tostring (unstore=0x2, tsrm_ls=<value optimized out>) at /home/pthreads-0.0.38/src/store.c:182 #3 pthreads_store_create (unstore=0x2, tsrm_ls=<value optimized out>) at /home/pthreads-0.0.38/src/store.c:273 #4 0xb6d3a60a in pthreads_store_separate (pzval=0x0, separated=0xb650e354, allocate=1 '\001', tsrm_ls=0x9f5ca88) at /home/pthreads-0.0.38/src/store.c:143 #5 0xb6d391e1 in pthreads_prepared_entry (thread=0x9f5c348, candidate=0xb6f05c5c, tsrm_ls=0x9f5ca88) at /home/pthreads-0.0.38/src/prepare.c:213 #6 0xb6d395e0 in pthreads_prepare (thread=0x9f5c348, tsrm_ls=0x9f5ca88) at /home/pthreads-0.0.38/src/prepare.c:311 #7 0xb6d3cc6b in pthreads_routine (arg=0x9f5c348) at /home/pthreads-0.0.38/src/object.c:619 #8 0xb7097955 in start_thread () from /lib/i686/cmov/libpthread.so.0 #9 0xb70171de in clone () from /lib/i686/cmov/libc.so.6 Test script: --------------- <?php dl('pthreads.so'); error_reporting(E_ALL); class ThreadTest extends Worker { public $t = 0; public function run(){ $i=0; while(true){ if ($this->t == 1) { echo "counter++\n"; test::instance()->counter++; } if ($this->t == 2) { try { echo "test123\n"; echo test::instance()->getCounter()."\n"; echo "test123\n"; } catch (Exception $ex) { echo $ex->getMessage(); } } sleep(rand(1, 3)); } return $i; } } class test { static private $ins = null; public static function instance() { if (self::$ins == null) { self::$ins = new test(); } return self::$ins; } public $counter = 1; public function getCounter() { return "c:".$this->counter; } } $counter = 1; echo "test: ".test::instance()->getCounter()."\n"; $thread = new ThreadTest(); $thread->t = 1; $thread2 = new ThreadTest(); $thread2->t = 2; if($thread->start() && $thread2->start()) { sleep(60); }