Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124493 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 qa.php.net (Postfix) with ESMTPS id C27AC1A00B7 for ; Thu, 18 Jul 2024 19:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721329975; bh=4XRymKdvhjl1krTYgwr7G7EUP8hj0Ze3psUGo17RGlU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=H79w/D7kbORH5ev/vd1EDktpeWk+CLlvgKeRoHKzQTmdc7ZAxPi540GRnAu7ns8N/ LLDxcboq6q0sOow9PdOrQ+fZjPGiw4XMcSRzoTTYpzCsL3+vWFE5PW5pB8XQS5Id7m Ft58eS8qORxKWTYRKy7IWGBlkKZgmxazr2yBdlxASMYZAhP4ynBlz+hdZzWsdq5bDW cwW05YgZmH+BQwa4OPO0Q6vOwvFAGv3V9qM5VkIDADnHk8C5SOt+RNws6bDpeuxUa5 hp9pPSmrGcEjnk/slu/tHvXeqaFFLSYgaWkJX/xg9a53yk8U8Qx4MH7gCW7gpsZH0c 0BkkyJMEx5bhQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8A84418003F for ; Thu, 18 Jul 2024 19:12:54 +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: No X-Envelope-From: Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 ; Thu, 18 Jul 2024 19:12:54 +0000 (UTC) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4266f3e0df8so5714225e9.2 for ; Thu, 18 Jul 2024 12:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721329882; x=1721934682; 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=4XRymKdvhjl1krTYgwr7G7EUP8hj0Ze3psUGo17RGlU=; b=RHclbcm5LPY3ZDylKmkxSV67qtpu5Rf4KCJ9L9L9aH2jmOYSv2KlN4rDwPZptliS3D LXdrzdUY/edfugqDw2L3/5+cnwlSqc63Hx4/ZY2mo6IresTPIaADVzTE1Kjxz49rXr1D BMuwB+wYv4JuGCEPZJVr0o4UIX4gCVeOpra2kk6GoCFB4Jsvm/tGPEUq7uc6KiVU6fxF q3ETrHBrjVj/OOfNCt5gUs5g2+HIVdrTRsJCQHbRslk96szcdZLCm+53M4VPCh/reKbr RgE8hQ57iciSfko4VXCCvog0lptKHXigyVpjZ+eP0LFhE0TLjeJ1K2cqI5lL76guroa9 wG3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721329882; x=1721934682; 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=4XRymKdvhjl1krTYgwr7G7EUP8hj0Ze3psUGo17RGlU=; b=DdXA+vPJ4BPIU+V/62qwiivl5yXfl5ToB/zQtvku7cI1wQxohS0YRduImL5bcaDDdW 42gQXGZTx4yGrKfAQ30CJniKiQtemf70R5n/I7UYTbK76Hzgzwuq+7WxZizu5tfOCYip WhaCCPV7OuTNv+jcHA9CDuM55QWNxb28s9UgUY+Y28Xr340MeFuChQxlhIiINmmlpAxA /VfJ7JzcnS2dBtWnPtXb/MuXIK5BAE7gduEqMNfcjAkWbfZigsqRam+hU6yqF1g95azo bCtw4ij0MwPHcNrcjBGotFdNhsceUtJqVnjToL9acKycrHcss1k1gbF35p7C4S9j3aJD RMKA== X-Forwarded-Encrypted: i=1; AJvYcCXXXgoEoRVceB5tM6Y9HgtShvPSHm7C/w6/BNM6/HNNUzgfyBtw/YJs9hCJ8gCjisPxzb3/fiWuvBnpXiYK2Vx6eq6pkvpIug== X-Gm-Message-State: AOJu0Yw11DT+jHlOB3diDbC2kBfp3XtCRWhObFIO0YR339nupzGTrehy 6OzCt3KtIdl34U2BVbRd1YpVg7zMc+nCP3e77yX3GpYFHXrdMhGeOtIWADjkVnj/vhw2NNdry2f XzMbbw5IakFtfBMUFD319WTU7exM= X-Google-Smtp-Source: AGHT+IGwg+QobQHPN96Ti/T5YpHA0Ssg+t6iTpfCOpzOl8Tk76ESmGGtW4jOpvPOLuUCvjqt0EKJberNRw/CPbh+gC0= X-Received: by 2002:a05:600c:450c:b0:426:6099:6ea4 with SMTP id 5b1f17b1804b1-427c2d0d87cmr41479635e9.38.1721329881888; Thu, 18 Jul 2024 12:11:21 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1118bbcd-a7b4-47bf-bf35-1a36ab4628e1@bastelstu.be> <45847b93-02bf-459f-bcd2-81ba35a12c24@bastelstu.be> <46bd4098-2936-4e46-98e9-fe55118325c2@bastelstu.be> <61ab36bc-b045-452a-84e0-87367d4c680e@bastelstu.be> <07e065f2-8f64-4bad-9a98-51f4eaf63ddb@app.fastmail.com> <2a0a4650-c2c5-4c6d-ad3a-25365b3391b2@bastelstu.be> In-Reply-To: Date: Thu, 18 Jul 2024 21:11:10 +0200 Message-ID: Subject: Re: [PHP-DEV] [RFC] Lazy Objects To: Philip Hofstetter Cc: Nicolas Grekas , php internals , Larry Garfield Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: arnaud.lb@gmail.com (Arnaud Le Blanc) Hi Philip, On Thu, Jul 18, 2024 at 12:19=E2=80=AFPM Philip Hofstetter wrote: > Super minor nitpick: You have updated the prototype, but not the explanat= ion text which still says: > >> When initialization is required, the $initializer is called with the obj= ect as first parameter. The initializer should initialize the object, and m= ust return null (or void). See the =E2=80=9CInitialization Sequence=E2=80= =9D section. I've updated the text as suggested, as the Initialization Sequence section also specifies how the function should return. The Initialization Sequence section says approximately the same thing, however: "The initializer must return null or no value. If the initializer returns something other than null, a TypeError is thrown". The reason is that all function calls evaluate to a value, including when calling a void function, so void functions actually return null. Unfortunately we have no good way to enforce a void return, unless we check the declared return type of the function, but it would not work for all kinds of callables. Documenting the signature as returning void is fine, though. Note that the return value is not important currently: We just check that it's null so that we reserve the possibility to give the return value a meaning in the future. Best Regards, Arnaud