Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124471 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 59E351A00B7 for ; Thu, 18 Jul 2024 10:18:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1721298003; bh=dDSfFR92lOnr0DPac05kWg6MvCTk5+EJ6xzSqlskay4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JIHKrVn33pNi2kxnwBnz1SJhasL997xcWpfGiGRb2giLkmcOe+808gu1WOgWZb2jm dklA0VXamOWnTnzOPvOwn3xv0lI1ClQTEn8Bu24XV2p1nU5IlseHbN3jteSVztxyAj h2dqRAmvejN3tjGf6taIKMEkxOzNmznC20Lke2fJ618e29y2K0O8J3FQu1t+Vuq+9V AX58gpB40ecGTBA+/VjxcbtcF+HXZqEgQVnVo6kaLQBnDZ3/5MutqJaWe7hOGordoL yH/Djt0Qw7q6S8IucxjZ3Jrvc9qIpi8KXC7jFsKVXE6xFjn6zYW3W61XXlTCs/ir4S FBqJL/I9JrzyQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ACA10180667 for ; Thu, 18 Jul 2024 10:20:02 +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_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (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 10:20:02 +0000 (UTC) Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5c2011716a3so235916eaf.1 for ; Thu, 18 Jul 2024 03:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sensational.ch; s=google; t=1721297911; x=1721902711; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ktS6b6QP77S0Jh1KOFxxSHdJkTfCeQ7towbMKUuqkUA=; b=ai8pVwvEow6Fi88ka8MgAJFcTNtVuUknUNUCVT8xi7jfHbTgKfARbIHSv5a4FinTqj p2fUvJuHTh4Dt1kpAsg/3LNaL5nPWjQd+grv2tEd3xN9E4M45H8oJOQ7kWSgDhpgBltp bUWv3T3diRXeZqNPXgAgBAVQaml7bwAfgyhuzIKHjZhT6YnPBHWOg3QrUWtSJ/FyAifA nRDvHUCIF7DPip73TnzwxrEYZalHF1+oEdPSKCCIBvnGaqtkN+w7hmuAR/gwYHeVT0WZ V8MfXrzDtW6JxmEaavWGVZ/uS1oaqsOG7BFCYqbyikThKUbwikistY7iideK5KwqsVtv r1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721297911; x=1721902711; h=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=ktS6b6QP77S0Jh1KOFxxSHdJkTfCeQ7towbMKUuqkUA=; b=bMFJkYnHeGMqjY6Yv2UpzcUi2ja7YztbOuu3aN7Dy0CuALtZgBY0k3GGjsp9eOhBvZ qBQE/DHD08a5rozsUGF8TkHjs20oCSWPb/HTksmuAtPmhvJD3a843U3DwnkUDKD3XI4b iioaseYlr9CnpL8BfeebTUjjBhWVtJwyasl/OrVfo07Yy4URidzCdb5qoVcL0xUirL6j Kv5rOsvpWu+uVWvccPpL4v66G5GV1nS0FbQe7eJK6ayF2EKAAQPGvsBZXWcAWzrGyLx8 C103eCfCg2YwQ9JuyfW0XLl9NOKkW2TJX5BzfAMbzw+hTSjRZ+SErVHfXBnYeoY+K9wM yKkA== X-Gm-Message-State: AOJu0YyR8qLCV/wJaQhncICWGttYmcMBej+wU8aXTg/uvu0QBkqLo2OZ SR40sKNzibtmcNzzRr9U/bkhD0RkBXIV2rwLAk913jbR+DGVAosmngP70nVZAQRKdkh7C6vAV8N b4Yl2aAf5MRgqkNPedczdTF/nE2Vh6J+d43sR0l7Is1Ov/3fX X-Google-Smtp-Source: AGHT+IEqT5T/vsFRtuTLUHObdenITKDmh9Ar020euz+9eVJwE52bgrBKmRj7L/pO2YH4QrBF9P0UfUV0FhtLNbt/xrw= X-Received: by 2002:a05:6871:e026:b0:25e:7a9:b603 with SMTP id 586e51a60fabf-260d90084bemr3128945fac.5.1721297910791; Thu, 18 Jul 2024 03:18:30 -0700 (PDT) Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Thu, 18 Jul 2024 03:18:30 -0700 Received: from 1064022179695 named unknown by gmailapi.google.com with HTTPREST; Thu, 18 Jul 2024 05:18:26 -0500 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 (Mimestream 1.3.6) 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 03:18:30 -0700 Message-ID: Subject: Re: [PHP-DEV] [RFC] Lazy Objects To: Nicolas Grekas Cc: php internals , Larry Garfield Content-Type: multipart/alternative; boundary="000000000000869a07061d82e641" From: phofstetter@sensational.ch (Philip Hofstetter) --000000000000869a07061d82e641 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Minor point: Why is the $initializer return type null, instead of void? I >> don't see a purpose to allowing an explicit null return and nothing else= . >> > > Updated to use "void". Both would work :) > > Super minor nitpick: You have updated the prototype, but not the explanation text which still says: When initialization is required, the $initializer is called with the object > as first parameter. The initializer should initialize the object, and mus= t > return null (or void). See the =E2=80=9CInitialization Sequence=E2=80=9D = section. > However, given the `:void` return type, you can=E2=80=99t `return null` - t= hat would be a fatal error. The phrase should probably be When initialization is required, the $initializer is called with the object > as first parameter. The initializer should initialize the object. See the > =E2=80=9CInitialization Sequence=E2=80=9D section. > Philip --000000000000869a07061d82e641 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Minor point: Why is the $initializer return type null, instea= d of void?=C2=A0 I don't see a purpose to allowing an explicit null ret= urn and nothing else.

Updated to use &q= uot;void". Both would work :)


Super minor nitpick: You have = updated the prototype, but not the explanation text which still says:
=

When initialization is required= , the $initializer is called with the object as first parameter. The initia= lizer should initialize the object, and must return null (or void). See the= =E2=80=9CInitialization Sequence=E2=80=9D section.

=20
However, given the `:void` return type, you can=E2=80=99t = `return null` - that would be a fatal error.

The phrase should probably be

=
When initialization i= s required, the $initializer is called with the object as first parameter. = The initializer should initialize the object. See the =E2=80=9CInitializati= on Sequence=E2=80=9D section.

Philip=
--000000000000869a07061d82e641--