ID: 24884 Updated by: [EMAIL PROTECTED] Reported By: auroraeosrose at hotmail dot com -Status: Open +Status: Verified Bug Type: Zend Engine 2 problem -Operating System: Win XP Pro SP1 +Operating System: * PHP Version: 5CVS-2003-07-31 (dev) New Comment:
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (runnable)] 0x8381fd4 in zend_clone_handler (execute_data=0xbfffd1ec, op_array=0x41c760b0) at /usr/src/web/php/php5/Zend/zend_execute.c:3042 3042 if (Z_TYPE_P(obj) != IS_OBJECT) { (gdb) bt #0 0x8381fd4 in zend_clone_handler (execute_data=0xbfffd1ec, op_array=0x41c760b0) at /usr/src/web/php/php5/Zend/zend_execute.c:3042 #1 0x837b22b in execute (op_array=0x41c760b0) at /usr/src/web/php/php5/Zend/zend_execute.c:1199 #2 0x8380278 in zend_do_fcall_common_helper (execute_data=0xbfffd4dc, op_array=0x41c72d60) at /usr/src/web/php/php5/Zend/zend_execute.c:2529 #3 0x83806ee in zend_do_fcall_by_name_handler (execute_data=0xbfffd4dc, op_array=0x41c72d60) at /usr/src/web/php/php5/Zend/zend_execute.c:2602 #4 0x837b22b in execute (op_array=0x41c72d60) at /usr/src/web/php/php5/Zend/zend_execute.c:1199 #5 0x835a174 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/web/php/php5/Zend/zend.c:1032 #6 0x8313b6e in php_execute_script (primary_file=0xbffff870) at /usr/src/web/php/php5/main/main.c:1573 #7 0x83959df in main (argc=3, argv=0xbffff8e4) at /usr/src/web/php/php5/sapi/cli/php_cli.c:910 #8 0x4055b9cb in __libc_start_main (main=0x8394c04 <main>, argc=3, argv=0xbffff8e4, init=0x80b5b6c <_init>, fini=0x84f3f94 <_fini>, rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbffff8dc) at ../sysdeps/generic/libc-start.c:92 Previous Comments: ------------------------------------------------------------------------ [2003-07-31 09:40:19] auroraeosrose at hotmail dot com Description: ------------ calling $this->__clone(); inside a class crashes php Latest CVS snapshot, apache 2 filter, gd, mbstring, and mysql dlls Reason for calling it is attempting to create a backward compatible solution for cloning objects without a 5 ini setting change or seperate 4 and 5 codebases Reproduce code: --------------- <?php class Test { function __copy() { $string = PHP_VERSION; $version = $string{0}; if($string < 5) { return $this; } else { return $this->__clone(); } } } $test = new Test(); $test2 = $test->__copy(); ?> Expected result: ---------------- If using php4, a copy of the object will be returned, if using php5, the current object should be cloned and returned. Actual result: -------------- php and apache die actually calling $this->__clone(); anywhere in a class crashes ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24884&edit=1