Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124642 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 0A6661A00C8 for ; Sat, 27 Jul 2024 09:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722074189; bh=XmFjfwP54YRbcYTjq5hXZp8LIJY2tiy0TKzINjJpQ68=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oCXElrHmkkE7QKTfr6DZ37Jp+eVBWMcn5UVt+8DvrRbZbYhHzGdbVpcRxgNWcaNHM XaN7zrYUFsofuXg4iKQgklmAFuhwWbJUj450XqpXONOxVjgL1JFn+wo2ECbC8GqQrD 3814iLGllEjn8aBAfO+cggcew298t4eZlHcyGGDUL7fVJBtF5YOVXP0qzaO2dMsHgm ej6qDx6AqokJDKQQT1Mxl0+ojP4k3cBadQ1GKu7cWrUzCfEI9e0CNkTEFYRFVxRkWu jg2iN88OmNfark2wVC331sxv7i7XxHO8G1hYQz2yoQGUdztQ3xxSI1BUizh+GtccDl MVGNNPoZBs18A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ECE35180072 for ; Sat, 27 Jul 2024 09:56:26 +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, HTML_MESSAGE,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-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (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 ; Sat, 27 Jul 2024 09:56:24 +0000 (UTC) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-654cf0a069eso4254267b3.1 for ; Sat, 27 Jul 2024 02:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722074088; x=1722678888; 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=d3I9PIvd1UuLV+WPpu5e//3TZoMY8xT5QadF+1kQCRc=; b=O03lNFpHcGDgHjv3VrLEpZAuSbxQ+8xjNdmj23cU0IdImTDuCAoLNj+iP5/bYGhxNK MZRh1gPvWDCptLfJAl0qYRwgrx/s7C2iGmnQqlwqkHqnZfitfutcFM8Io/f3X43s4BTK /JL5/9mLiI7EbRYVB/mTZjPwyIYG1pgXAoGtFuxaRQ/w/gBtvpRZZZ5SJ3ZcLPcr/m9k MCeiAHGxgaxOQLfl4r835W9DjuYKyK2BUACg2MAUA/8ChQBJFZ6robuypRLXtehrHZWf GwsuBqgR98zliqC4P5PlqmdYyYZ1b6fq+0AeyJ/7upnnsNCHWXLKllL/O0bseBF8WP3+ rDBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722074088; x=1722678888; 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=d3I9PIvd1UuLV+WPpu5e//3TZoMY8xT5QadF+1kQCRc=; b=wvGxor9wPvnYh9g0E94vu5FdVPWnKlvu2E6UVveVyOpTEkesKJ2PDa1gryEkCLNgTl KaYhDChyu0TwGvZ4Os8mPuIVOBoxFwcVBmeXMnD/gVjSGxBWFELilETVtcQPmOE8cu7/ 1eowvHhjuzmL+DDXWcbxe81QZCPVFYOZYI2WWa90034sytEL9AiUB8cxim95Cx0S5Ye/ Srep81gZqwlJNPQfYfL1RrZn0JNUcNU5DxwpTKKpseTKcbmwZAbnyD/k9lfcl3C1o8t7 /C70YU1v+nzMsy7UhQfJxgR+bbayhztGu5DgVBJLTG2qAyjM+Q6RJXQtLUSN09Im3LMc yVBQ== X-Gm-Message-State: AOJu0Yz1bMAdRGQZ/715dBjnETL3HDo8XJ9Eo6Mco8PJkLBb9SBZSFrS kb1nvhopdfG6a+fxvi5V6qGSbyeZySBo0UzIcqyJuHUdzGGb9MW+G+rlUa2ucSnw0o1iI9Cx8Yp t9zcNfXVFw4CYVtnWfOTbyya00XibXnpJ8pg= X-Google-Smtp-Source: AGHT+IE4yL7lzDsLJML/um1koZ5H85obbGfQs1hX/ikerDX4Gzj2EmmKzowBFc38kNLj8caMBXIHiWVdLq0HaHCe44s= X-Received: by 2002:a0d:c641:0:b0:65f:e307:d41 with SMTP id 00721157ae682-67a06a0c051mr25271207b3.16.1722074087778; Sat, 27 Jul 2024 02:54:47 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <1a88918e-e808-d778-45e1-53797660e093@php.net> <95147d9d-d6e8-4396-bf0b-409c33679f90@bastelstu.be> <6c0baa01-68e5-4d74-bc4e-d6830ab5076d@bastelstu.be> In-Reply-To: <6c0baa01-68e5-4d74-bc4e-d6830ab5076d@bastelstu.be> Date: Sat, 27 Jul 2024 02:54:12 -0700 Message-ID: Subject: Re: [PHP-DEV] [RFC] [VOTE] Deprecations for PHP 8.4 To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000477684061e379e5c" From: sarkedev@gmail.com (Peter Stalman) --000000000000477684061e379e5c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jul 26, 2024, 04:58 Tim D=C3=BCsterhus wrote: > > I just Googled "PHP tutorial" and found https://www.phptutorial.net/ as > the second search result, which considers itself to be "the modern PHP > tutorial". > > I've clicked at the CSRF section > (https://www.phptutorial.net/php-tutorial/php-csrf/) and what do I find: > > > $_SESSION['token'] =3D md5(uniqid(mt_rand(), true)); > > *Exactly* the md5-uniqid construction that is called out as unsafe in > the RFC and used in a security context. > > Further down on the first page I find > https://www.tutorialspoint.com/php/php_mysql_login.htm, which does not > even hash the passwords that are stored within the database. At least > it's using `mysqli_real_escape_string()`. > > Then I have the German php-einfach.de, which on > https://www.php-einfach.de/php-tutorial/die-wichtigsten-php-funktionen/ > ("the most important PHP functions") lists md5() and sha1() as an > important function, but does not mention hash() at all. > > I'm sure I would find quite a few more, but I believe those already > support the point I was trying to make. > I don't think the examples you provided support the argument for deprecating these functions. If anything, they highlight the real problem: outdated tutorials being prominently featured in search results. As you mentioned, the MySQL login one doesn't even use a hashing function, so deprecating md5 and sha1 functions would do nothing to fix that! And how are these the top results? Are you telling me that the PHP community can't create better websites and SEO than these ancient tutorials= ? If someone encounters a problem because they can't use the md5() function, they're likely to Google it and find a simple workaround like "just paste this code and it'll work again." mentioned above. That would be just like this deprecation proposal: identifying the wrong solution to the actual problem. The real question is, why aren't there better, more up-to-date resources easily available for someone wanting to learn PHP in 2024? We're the PHP community, we should be leading the web and SEO. Yet most people looking to get into webdev today aren't reaching for PHP. I've seen recent videos where developers are positively surprised by PHP's modern features. But can we blame them for being surprised if these are the top tutorials out there? Deprecating these functions isn't addressing the core issue. The focus should be on making it easy for new learners to access up-to-date tutorials= . Thanks, Peter --000000000000477684061e379e5c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jul 26, 2024, 04:58 Tim D=C3=BCsterhu= s <tim@bastelstu.be> wrote:

I just Googled "PHP tutorial" and found = https://www.phptutorial.net/ as
the second search result, which considers itself to be "the modern PHP=
tutorial".

I've clicked at the CSRF section
(https://www.phptutorial.net= /php-tutorial/php-csrf/) and what do I find:

=C2=A0> $_SESSION['token'] =3D md5(uniqid(mt_rand(), true));

*Exactly* the md5-uniqid construction that is called out as unsafe in
the RFC and used in a security context.

Further down on the first page I find
https://www.tutorialspoi= nt.com/php/php_mysql_login.htm, which does not
even hash the passwords that are stored within the database. At least
it's using `mysqli_real_escape_string()`.

Then I have the German php-einfach.de, which on
https:/= /www.php-einfach.de/php-tutorial/die-wichtigsten-php-funktionen/
("the most important PHP functions") lists md5() and sha1() as an=
important function, but does not mention hash() at all.

I'm sure I would find quite a few more, but I believe those already support the point I was trying to make.

I don't think the examples you p= rovided support the argument for deprecating these functions. If anything, = they highlight the real problem: outdated tutorials being prominently featu= red in search results.=C2=A0 As you mentioned, the MySQL login one doesn= 9;t even use a hashing function, so deprecating md5 and sha1 functions woul= d do nothing to fix that!

And how are these the top results? Are you= telling me that the PHP community can't create better websites and SEO= than these ancient tutorials?

If someone encounters a problem becau= se they can't use the md5() function, they're likely to Google it a= nd find a simple workaround like "just paste this code and it'll w= ork again." mentioned above. That would be just like this deprecation = proposal: identifying the wrong solution to the actual problem.

The = real question is, why aren't there better, more up-to-date resources ea= sily available for someone wanting to learn PHP in 2024? We're the PHP = community, we should be leading the web and SEO. Yet most people looking to= get into webdev today aren't reaching for PHP. I've seen recent vi= deos where developers are positively surprised by PHP's modern features= .=C2=A0 But can we blame them for being surprised if these are the top tuto= rials out there?

Deprecating these functions isn't addressing th= e core issue.=C2=A0The focus should be on making it easy for new learners t= o access up-to-date tutorials.

Thanks,
Peter

=


--000000000000477684061e379e5c--