-
-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Labels
Description
Tempest version
git 3.x (afe65d3)
PHP version
8.5
Operating system
Linux
Description
CRC-32 as used by the ViewCache in
| $cacheKey = (string) crc32($path); |
has a 32-bit output size, which means that collisions are expected with a 50% chance at ~65k different inputs. However there are even trivially matching pairs when just looking at English words.
Steps to reproduce
Run env ENVIRONMENT=production php test.php for:
<?php
use Tempest\Core\Tempest;
use Tempest\View\ViewRenderer;
require('vendor/autoload.php');
$container = Tempest::boot(__DIR__, []);
$renderer = $container->get(ViewRenderer::class);
var_dump($renderer->render('petfood'));
var_dump($renderer->render('eisenhower'));This incorrectly outputs:
string(7) "petfood"
string(7) "petfood"