Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120838 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61315 invoked from network); 18 Jul 2023 15:58:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jul 2023 15:58:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F306C1804A7 for ; Tue, 18 Jul 2023 08:58:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 18 Jul 2023 08:58:03 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3fbea147034so54932335e9.0 for ; Tue, 18 Jul 2023 08:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; t=1689695882; x=1692287882; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=zoz4h1nSP2LPZ/IJEwYp3KF8zC8XZortb6/gt9BgYRI=; b=L6F3MP+0H5nY1VTi0V3s+RfBGsPe9i2CxvUjFcs57Ielof7VGn3fyC3JfikA8KD6qS deWWBogjkmJKHaQnL4EZ6TaJyLxEPMlkUqC1EqpkoRLlJTmWDt7ik/Bi8+NrRy62pKTX WuwR/S3I35bsVeVwMLglTF7CNhNvFSlfriwiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689695882; x=1692287882; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zoz4h1nSP2LPZ/IJEwYp3KF8zC8XZortb6/gt9BgYRI=; b=D/LXq9bMG7f0FwDGO3G1rHDabPJ7E/6c/F0j5WHQFNjvqZGM7nvtfHCil2PO215B6S wBTSLRUqth5bUz9SaxxcmRxH1Re08LpouS8+VHerzdGB7NNkl4GrW+11BU8e6tZa9BzI WjA71ceD9U1HElJ7gPehLNed3rm8RDKmcXkm4cNc+kXOC1HiqPWULyIGGC3BcNX3PcK+ OTDzty/pVPntksmXTKKob6Xlt03Ip5xg/wbb2ebt47hgv9Rt0TAPcxP8SjMTiAjDiZiL KG9naxJzsGlQAVhnoNW2S5qy8wbYzyHXN2YbIMZlGGp4EJk9z56513zEvNmK7rauyDbB V5rg== X-Gm-Message-State: ABy/qLYI2jNok2lZY6zPJGeGgv3f5iZO0mlRUgHLYgx06FBPdkcaoHgb dvjiIgCO8xjNTFyOOYaCW625+xMxo4kkdzepUWWlIA== X-Google-Smtp-Source: APBJJlG0JzeRj6KLm90JxhWMwW/YnytGZQUYAsfPN3v24obTAfRs2TTFema/tvHwTIlkaM7yejrWEg== X-Received: by 2002:a05:600c:247:b0:3fb:b34f:6cd4 with SMTP id 7-20020a05600c024700b003fbb34f6cd4mr2164585wmj.36.1689695882085; Tue, 18 Jul 2023 08:58:02 -0700 (PDT) Received: from smtpclient.apple ([95.147.148.9]) by smtp.gmail.com with ESMTPSA id 20-20020a05600c22d400b003fbc9d178a8sm10624412wmg.4.2023.07.18.08.58.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2023 08:58:01 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Date: Tue, 18 Jul 2023 16:57:50 +0100 References: <8055b366-32f1-4d2c-85d0-0cf665e6c8d3@app.fastmail.com> <51a97131-f64e-4939-9339-24e70873fe32@app.fastmail.com> To: php internals In-Reply-To: <51a97131-f64e-4939-9339-24e70873fe32@app.fastmail.com> Message-ID: <30DC7449-43B1-4ABC-9617-A9C8E41E0A5F@craigfrancis.co.uk> X-Mailer: Apple Mail (2.3731.600.7) Subject: Re: [PHP-DEV] pipes, scalar objects and on? From: craig@craigfrancis.co.uk (Craig Francis) On 18 Jul 2023, at 16:13, Larry Garfield wrote: > PHP at the moment leans heavily on the "null is error and build = tooling around that" approach Yep, you should never use NULL in your code, the following is = catastrophically bad... =20 $search =3D ($_GET['q'] ?? NULL); $search =3D (isset($_GET['q']) ? $_GET['q'] : NULL); // Pre PHP 7 =20 $search =3D filter_input(INPUT_GET, 'q'); =20 $search =3D $request->input('q'); // Laravel $search =3D $request->get('q'); // Symfony $search =3D $this->request->getQuery('q'); // CakePHP $search =3D $request->getGet('q'); // CodeIgniter $search =3D json_decode('{"q":null}'); And all fields in the database must be set to NOT NULL, never use things = like LEFT JOIN, etc... :-( Craig