Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101989 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15968 invoked from network); 20 Mar 2018 23:14:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2018 23:14:46 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.51 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.51 mail-wm0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:32883] helo=mail-wm0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/62-03694-5E591BA5 for ; Tue, 20 Mar 2018 18:14:45 -0500 Received: by mail-wm0-f51.google.com with SMTP id i189so3910763wmf.0 for ; Tue, 20 Mar 2018 16:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=ckWaplgp8UJ/ykeHJdqhIVkM9NSnC/EsRl/HXYcpSOY=; b=mJn4rBF3WizUc+5je2NJNuEr3X8zmvpbRyMdPVT2pv48Lb7XncKaVKjlcz/2G77UEc MZ4ArdKECyHH14nEpSZktSoIxaBRlv+h1eHSji8GGkEXMdnSb7rn98xqE90ZvSP9V0xJ uE4DZKo4U5axXMQux1SIIboZ3xRWEFbZBzmhwMyaGLHMtDiV9HHmYuarqXT5y6FtElbD KE/8/OJRsEzReNm4z4IVa07x9JXWNauJ59nOcQPZpLixFg5Gd06qsp1NbbdTK9iyG3rR QEruWrkjpVUkJifpcrD/72E3Xd1Lw8CntlPAHl318hw3BTcRtiYt4/vmrPjrxbc4SRoW g1XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ckWaplgp8UJ/ykeHJdqhIVkM9NSnC/EsRl/HXYcpSOY=; b=FliooCrHGqayCaoYy815GvB3pj5ZcD3M6uYTqP3zjE+6ybzdZGbH+ZpdjVAlAyuRCm KeI5RzuVPljl5sUCYSEDlESem33//ras/m7HIIexgj17L1iotxXbEvJUbWQt5m9Zz1fg ZAwqQQ1a1TDeJxFhGwiDtLxHBkO1IYAnknvgDjmF6EZZxLPw3Hf322aZ1/hdWXNC7H3U 5wSHUOwR+LHtwQmvH6+E6wkcWERbi0uQNVAjSjKp6TAWG6mLSAAXp56KsP5mhxUxQVwP 7bUcEv3FXMHYxmdO+PkObMPXFnbQputi/3Gf45l82R8C6hCSA319xhoAwLzAZyvxqce/ /Faw== X-Gm-Message-State: AElRT7E1KO0YHowmN+iY+BZpwOnwTOZbe0SMZnZII+XZN9GIkjsvqrWE 2zdmy+avqO9aE7bds6QlypMhLA== X-Google-Smtp-Source: AG47ELu6QrLvo5+mCFSOPOqXGJjH/CIFl/UxOzzEThMNkropRQoXICz6Vvm5PfDnKD5LBJy7lb7FoA== X-Received: by 10.28.140.11 with SMTP id o11mr998096wmd.82.1521587682349; Tue, 20 Mar 2018 16:14:42 -0700 (PDT) Received: from ?IPv6:2a00:23c4:4b86:4b00:b58b:b021:853b:3cb5? ([2a00:23c4:4b86:4b00:b58b:b021:853b:3cb5]) by smtp.googlemail.com with ESMTPSA id 21sm5757025wrt.82.2018.03.20.16.14.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 16:14:41 -0700 (PDT) To: internals@lists.php.net References: Message-ID: Date: Tue, 20 Mar 2018 23:14:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] Weird destructor call order on stream wrappers From: rowan.collins@gmail.com (Rowan Collins) On 20/03/2018 22:13, Dennis Birkholz wrote: > P.s.: > In addition to the call order, in auto-close case autoloading with > registered autoloaders does not work inside stream_flush and > stream_close, it seems registered autoloaders (maybe all objects) have > been dispatched when the calls happen, see: https://3v4l.org/GB7Mm The behaviour with the stream wrapper certainly seems wrong to me, since there is clearly still a reference to the object after its destructor is called. The autoloader not being available seems reasonable, though - during shutdown, the engine has to start unpicking various global state in order to cleanly release any references, and there is no order to do this that would guarantee no code breaking. You demonstrate a stream wrapper relying on an autoloader, but we could equally have an autoloader that relied on a stream wrapper. If both needed to be available for the other, the engine could never cleanly free any resources they held, so it has to start somewhere. In general, anything that might run on shutdown, such as a destructor, should be very conservative in its assumptions about the engine's state. Regards, -- Rowan Collins [IMSoP]