From:             jaco at welnet dot nl
Operating system: CentOS 4.2
PHP version:      5.1.2
PHP Bug Type:     Reproducible crash
Bug description:  Segfault when using clone '$this>test2' notation in __clone 
method

Description:
------------
PHP segfaults when there is code like '$this->object = clone $this>object'
in __clone method. note the '>' syntax which is faulty ofcourse but
produces the segfault.

tested with latest cvs:
PHP 5.1.3-dev (cli) (built: Feb 13 2006 10:52:02)


Reproduce code:
---------------
class test2 {}

class test {
        public $test2;
        
        public function __construct() {
                $this->test2 = new test2();
        }
        
        public function __clone() {
                $test2 = clone $this>test2;
        }
}

$test = new test();
$test2 = clone $test; 

Expected result:
----------------
Notice: Use of undefined constant test2 - assumed 'test2' in FILE on line
XX

Notice: Object of class test could not be converted to int in FILE on line
XX


Actual result:
--------------
[Mon Feb 13 10:38:40 2006] [notice] child pid 12798 exit signal
Segmentation fault (11)


-- 
Edit bug report at http://bugs.php.net/?id=36376&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36376&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36376&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36376&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36376&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36376&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36376&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36376&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36376&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36376&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36376&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36376&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36376&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36376&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36376&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36376&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36376&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36376&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36376&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36376&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36376&r=mysqlcfg

Reply via email to