Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125044 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 E4E301A00BD for ; Mon, 19 Aug 2024 05:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1724045074; bh=1//+2+X/CXidEfSpj72p5rdspkvatkYiDm50AFfGxeg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=cd0r+iRzG2kqkFPOW+KaU4gNSY8AV7tFhidmSgF8UNFNI2wvRBLCPFi+msKIBogVe z9LKVUjW8dfSW2xWzWMuUwsFRhoXL3kuPwqDhmC0U7RAOGBu2k+HKo7T18Jo97SMck VeDmULhLYdfyI80L1AUMav91HphFNmXic/2YwMQFtR1yQzDt573v5ZI90zomoqFVMP vAO0qQ2Q2a63KxLMUANvHlJXoCGJGSigZ5PcmW8lpVmw/X4ebeYJW+z2p1LVDGddon 3nDZ1CpxdgCLuhZpxCexCdCD+vTZE9fdo01IzHJtPbQiGGYpQGsXz6Nma1lnlv74Sm hlGRwqT2yjEyA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 87F0C180071 for ; Mon, 19 Aug 2024 05:24:33 +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.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (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 ; Mon, 19 Aug 2024 05:24:33 +0000 (UTC) Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-685cc5415e8so38736957b3.3 for ; Sun, 18 Aug 2024 22:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20230601.gappssmtp.com; s=20230601; t=1724044964; x=1724649764; darn=lists.php.net; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZSVzzQjH2VGrfAMCjijIAndkbpdl+iVDxOvxuwC6HnY=; b=U49BAFH6y3kBt+13DUEls6Bw6IIbaGknIcBkqy6O1NefTEA+Br3jK51plBszRJFt51 2mTLrmCDLWpXPB4Ijy1j5hPSQHUspiGrd6wjnEfShWDfiJS7zNvnsoF/e5FZ6B5GqzIK pOz2sfGW9bhnbJR2guvMyk6Y7OJk0xqeMycewCNoKGjAF5YlzkRhhXlby5walrMD2P6T YTf9x+OVgwlhWkZAyRJMtYWCfYYnHkSCmpeRAzD3cDAMroRFJezkVN7YFrN4GCbrQf+t cDGvwA5+LqF8qJ8hyHHNoPpuW+HNIG1DyLbVQFvm1xK7pEhMPt3bleThY3DMG5Cwkb7Q e7FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724044964; x=1724649764; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZSVzzQjH2VGrfAMCjijIAndkbpdl+iVDxOvxuwC6HnY=; b=ToUZVjBqX6NozDKrMe5ZsyNPPt/JtjxBiU9+rBaNFPhxyaYA3zq+ghQ3LnrvZyLvhy k8TVWK9Fm//xK2cuRMeW4aReyVPYCHPTTiRj7G/Un0F7/Nwzahf4/mN6K51Kz6QZK77z E0lIfCRU+YnX9gpuyurmubg8Z+N7YnjgJ4T1oOThfnfAPq8GMOw8SngYXsEwxUzPILB4 8eUVNzXsTwuSQlE4pZK1bf+KovBEam3N/DeY0uUqGmq1+ihkr687BhDCFDB1sOHograQ jVn0VxIHWhA0aUbwSIjylj0Kf6xCLFJu0CikqFsE/RDDZYQQy3iG6Wv8C7r56KGvVrNY HE1Q== X-Gm-Message-State: AOJu0YyVP61I2qNkQPY4EgoegTlmN8snTpMY0v0y4BnM1OyV6gDc4wzp blB50MqAdKNnMkIDwDIrLO+FJ1IY5A62DGqxdn+U2bxOSeRh1A3u2odPYaF8JfInpGIu47Nlm28 gwOE= X-Google-Smtp-Source: AGHT+IE6XVNRs0pQA110nkN2Png+P77U3boQZNv0VRV/NJXauI+QqRO3alwRmVhFHDJ7aNvPwNJoJg== X-Received: by 2002:a05:690c:4d87:b0:6ad:8bbd:aec5 with SMTP id 00721157ae682-6b1b805107bmr125611347b3.14.1724044963880; Sun, 18 Aug 2024 22:22:43 -0700 (PDT) Received: from smtpclient.apple (c-98-252-216-111.hsd1.ga.comcast.net. [98.252.216.111]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6af93f08428sm15048497b3.0.2024.08.18.22.22.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Aug 2024 22:22:42 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: [PHP-DEV] Should there be a `get_declared_enums()` function ? In-Reply-To: Date: Mon, 19 Aug 2024 01:22:41 -0400 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <687E099C-6265-4848-A108-2948525DF38E@newclarity.net> References: <66BD5F05.8010409@adviesenzo.nl> <8dc51539-20bb-4017-b859-76066e2287e5@gmx.de> <4AA66A3E-1ACF-48F5-81A2-C6AAAE8B3FD0@newclarity.net> <66BFFC0C.1090900@adviesenzo.nl> <66C036DA.6090801@adviesenzo.nl> To: "Rowan Tommins [IMSoP]" X-Mailer: Apple Mail (2.3696.120.41.1.8) From: mike@newclarity.net (Mike Schinkel) > On Aug 18, 2024, at 4:59 AM, Rowan Tommins [IMSoP] = wrote: >=20 > On 18 August 2024 05:46:09 BST, Mike Schinkel = wrote: >> I know that those functions can be called as a function and return a = value like the following: >>=20 >> $return_value =3D include($path); >=20 > You are right that it has a return value, but wrong to put its = argument in parentheses. This will *not* do what you expect:=20 >=20 > $success =3D include($path) && somethingElse(); >=20 > Because include is not actually a function, what is evaluated is = `$path && somethingElse()`, then either `include true` or `include = false` (which will of course fail). >=20 > You instead need to write this:=20 >=20 > $success =3D (include $path) && somethingElse(); >=20 > I thought I'd added this example to the manual, but now can't find it. >=20 > Consequently, we can't just define optional parameters like we would a = normal function. We *could* extend the syntax to allow "include $path, = $whatever;" but it probably wouldn't feel very natural. It would be a = syntax error to write "include($path, $whatever)" just as "echo $foo, = $bar" is valid, but "echo($foo, $bar)" is not. Hi Rowan, Thank you for confirming the nature of include, et. al. So, if the functionality to be notified via a callback for all symbols = loaded is a desired feature by other than me and maybe Juliette then the = best approach I've come up with is to add an `spl_autoload_callback()` = function that can both get and set the callback to be called after = include or its 3 other friends are called. Anyone (else?) disagree? -Mike=