Pro tip: you can use Arr::random to create hard-to-reproduce bugs

Usage example:


{{ Arr::random([
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard', 'Dashboard',
'Dashborad', 'Dashbord', 'Dashbaord', 'Dasbhoard', 'Dashboar',
]) }}

This would show a random typo sometimes, but 9 out of 10 visits would see a correct `Dashboard` text on the anchor element.

12 thoughts on “Pro tip: you can use Arr::random to create hard-to-reproduce bugs”

  1. {{ substr($text = “Dashboard”, 0, -(int)round(rand(1,50) / 100) ?: strlen($text)) }}

    Way harder to find.

    Edit: Oh. I see now. There are multiple misspellings.

    I still think a randomiser would be more diabolical, because you can easily find the text string in the project with an array holding the actual text string shown on the page.

    Reply
  2. I did this recently to wind up one of the less tech inbolved directors of my main client. There’s been a typo on the UI for 4 years which has really bugged him, but he never reported it as an issue. It was only mentioned to me by the other director a couple of weeks back.

    So I fixed it. Sometimes. Just for his user account, it will display a completely different typo. But only 1 in 10 times.

    I’ve not had a report back yet.

    Reply

Leave a Comment