Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127271 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 524CE1A00BC for ; Fri, 2 May 2025 12:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1746190194; bh=NRoM7EGUKL3ZMYTVXE5vGIn04pMB4MzliU1/9TfTHAU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=TJkqCFLm6m+Iqf8P0nI7DW694rkAZqTvAvS3FgUDrH/svX0nSZwp7qy5FG8FDlUk7 XuBMH0L/3PvxXfy9udhj4lyO+wzdvfZK6eZD9gcWa6SxrWzr5lEe29ZHU2Svm0Jl9O PCxZzGBJiUu7C3iW4439FDBNh/6yUPnVdnXzej/Y8KrkWe+KkdNVZ0meMGZ1kBsrFt DKZAFUOxbn0qM8x1123FOGxso5nqKybzLaFHHuUvUjdq3O5YOZ+Phw8HdImd+a70Yi peKqsDstwmxAVZoIHaFUad02ObrE9RJTLUBDjvXx1eg1g0fHmzDfvSFy+ZOsouQTKO T2oDfF5JwAS/Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E2A56180034 for ; Fri, 2 May 2025 12:49:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 2 May 2025 12:49:53 +0000 (UTC) Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-70825de932bso29987437b3.0 for ; Fri, 02 May 2025 05:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1746190328; x=1746795128; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NRoM7EGUKL3ZMYTVXE5vGIn04pMB4MzliU1/9TfTHAU=; b=FGUiKMGM6ImQGBx8J2cM3x+DRsrmb/MeGFFK4ORv+4h8a690956KI9XQgDgKKV6bYy F0MKRD7WpvvT+lp02pPPZfIiiZf5ZLf9e0hDKuEzHDzqAzvI/VpAGR9T3+q0yrSNHvmp 5AuXXSYyQmqP6mSwPTYMIUZPlD0dHzpPJt3nqUP+zg6Po5OQ5xe96jp+vAO9J/XzPFOI 9nsiG9g4gmnI8JV5vunF1IG7mr82okxmGQak4yurhsqUYCNqhyzMh7FXS5ETsmG9Qv2B LEKTNkbOnmoDxt00yR/nKHHUdOp5N+pyDkkfqRI5a03/l9j0mRyOwrQmNvMtVzsXwOoa vP9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746190328; x=1746795128; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NRoM7EGUKL3ZMYTVXE5vGIn04pMB4MzliU1/9TfTHAU=; b=oJdHiAqNzvWJ+USTS1FH3iKe4W0LKPuKvAVV38244ydAjJrAtLMx8Sj7Iy4gw8evKH eaMm3IJIZFLGjpDGvu8bb5IuJTPGpH++VFK6CPBFPvJtLQDS0LdwCQCDOA9OCGrOy/Dx ZqyOhmvhVLycVXhzCzspWLdNsUDMs2NyANqKmxfuORH2PjsEso+HR/CKd6HN/266MpVG X4fBj2L6MU/Mn7Ki6m3xwamrZmWfC9iEjRElr/wtbKhR6b08QzhNwWn0zK3PBGfuBe05 cy82uySruhkdgR+VO6BlE7LrRkiCpCftnVj1DYwzUJ+7fGByKeglVriRwA1Q4suZ55HA o54Q== X-Gm-Message-State: AOJu0Yz1aEktDzZyEFHjR1HKAar9OgEtTeMHltE16OCu5de7UB9A9bFS Mxc/ysCIPxywVJib6XidFLenB1vrw3WCT93V7wcL3vPMsIGB7af5qfOZJ0KTFX7i4tvA0+Sd8H/ DFQQ173DOXhzSTqvLRC/qLSO8QSw7Iea7u1M= X-Gm-Gg: ASbGncsSd6rk92aNVDxF6YO84IilDIUYqtAau/x9XtoiYFnGSdmpqXZ4pOoAGzQLbP2 qnXfsMolS+HBxR1gcr2aT03+KVPjf2T0sovwEHKOaevNPNR1iJ+KyAmi17xLM3kNf0+DfahDBLZ wbNT0/XBE9gyzbJmCOGyD8PQ== X-Google-Smtp-Source: AGHT+IHuK1/J57KNTI76uqwMa1bwoKNpT/2IYzGjyEs30YZl7biI7GCFQ6IvmNWVNiv1Bun4pWmL/akYDerDYM/4BC8= X-Received: by 2002:a05:690c:6208:b0:706:aacc:d551 with SMTP id 00721157ae682-708ced464c2mr37368537b3.7.1746190328359; Fri, 02 May 2025 05:52:08 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 2 May 2025 15:51:59 +0300 X-Gm-Features: ATxdqUGV2Bv274xpm2yTqWa0TrH4JE5KRkAhxZn7OIcGWfFcS8naBwdIBS1qv4s Message-ID: Subject: Re: [PHP-DEV] Deferred backtrace generation algorithm. To: Rob Landers Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) Hello, Rob! > For what it is worth, the stack trace is not generated in the constructor= (at least from the perspective of the developer). This is a design feature. In PHP, call frames for PHP functions are stored in a separate stack. However, they are still stored following the stack (LIFO) principle. When a function returns a result, the memory of its frame will be overwritten by the next one. If the backtrace hasn=E2=80=99t been built while the stack still exists, th= ere might not be another chance. That=E2=80=99s the main technical challenge. For example, in Python (though this information might not be entirely accurate), frames are objects that can be reused. > Using reflection to create the exception without calling the constructor = still results in the stack trace being generated in the exception object. That's because PHP objects actually have two constructors: * The internal constructor * The PHP-land constructor, called __construct The internal constructor must always be called. -- Ed