|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-25 20:38 UTC] soporte at onfocus dot cl
[2006-02-24 10:47 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
Description: ------------ I have a segfault with a very specific code. I have an index.php that loads 2 class files, it also create a new class with a type checking in the constructor. This is the only way I found to reproduce the segfault. If I put everything in the same file it works. If I remove the type checking it works. If I remove the SPL implements it works. So, it looks like it is a combination of all this. Reproduce code: --------------- index.php -------------------- require_once 'objectlist.php'; require_once 'pouet.php'; class Test { function __construct(Pouet $p) { $this->jon = $p; } } $p = new Pouet(); $t = new Test($p); var_dump($t); objectlist.php -------------------- class ObjectList implements ArrayAccess { protected $data; function __construct() { $this->data = array(); } function key() { } function offsetExists($offset) { } function offsetGet($offset) { } function offsetSet($offset, $value) { } function offsetUnset($offset) { } } pouet.php -------------------- class Pouet extends ObjectList { function __construct() { parent::__construct(); $this->t = time(); } } Expected result: ---------------- object(Test)#2 (1) { ["jon"]=> object(Pouet)#1 (2) { ["data:protected"]=> array(0) { } ["t"]=> int(1129920211) } } Actual result: -------------- [notice] child pid 13812 exit signal Segmentation fault (11)