|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-07-14 12:34 UTC] franssen dot roland at gmail dot com
Description:
------------
I get an HTTP Aborted status code when accessing a property defined in a subclass of \MessageFormatter. It's really weird behavior.. please see the test scripts.
Test script:
---------------
<?php
namespace Foo;
class Test1 extends \MessageFormatter { }
class Test2 extends \MessageFormatter { public $foo = 'foo'; }
class MessageFormatter extends \MessageFormatter {
//public $foo = 'foo';
}
$test1 = new Test1('en_US', '{0}');
$test2 = new Test2('en_US', '{0}');
// CASE 1
var_dump($test1);
// CASE 2
var_dump($test2);
// CASE 3
var_dump($test1->getPattern(), $test2->getPattern());
// CASE 4
var_dump($test2->foo);
Expected result:
----------------
// CASE 1
object(Foo\Test1)#1 (0) { }
// CASE 2
object(Foo\Test2)#1 (0) { }
// CASE 3
string(3) "{0}" string(3) "{0}"
// CASE 4
string(3) "foo"
Actual result:
--------------
// CASE 1
object(Foo\Test1)#1 (0) { }
// CASE 2
HTTP Aborted (Connection was reinitialized)
// CASE 3
string(3) "{0}" string(3) "{0}"
// CASE 4
HTTP Aborted (Connection was reinitialized)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
Here's a minimal test case and backtrace: <?php class Test extends MessageFormatter { public $foo = 'foo'; /* <- causes the crash */ } $test = new Test('en_US', '{0}'); var_dump($test); ?> Program received signal SIGSEGV, Segmentation fault. 0x00000000008a9a1f in rebuild_object_properties (zobj=0x7ffff7fd4af8) at /home/felipe/dev/php-src/Zend/zend_object_handlers.c:71 71 zobj->properties_table[prop_info->offset]) { (gdb) p pos $12 = (HashPosition) 0x7ffff7fd5230 (gdb) p *pos $13 = {h = 6385231017, nKeyLength = 4, pData = 0x7ffff7fd52d8, pDataPtr = 0x0, pListNext = 0x0, pListLast = 0x0, pNext = 0x0, pLast = 0x0, arKey = 0x7ffff7fd5278 "foo"} (gdb) p prop_info->offset $14 = 0 (gdb) p zobj->properties_table $15 = (zval **) 0x0