xref: /php-src/ext/opcache/tests/jit/gh16829_2.inc (revision 79aaeeaf)
1<?php
2class Reproducer
3{
4    /**
5     * Remove $params arg and segfaults will go away
6     */
7    public static function loops(array $params = []): int
8    {
9        $arrCount = 2000;
10        # Replace `$arrCount % 16` with 0 and segfaults will go away
11        $arrCount2 = $arrCount - $arrCount % 16;
12        $result = 0;
13
14        for ($baseIdx = 0; $baseIdx < $arrCount2; $baseIdx++) {
15        }
16
17        while ($baseIdx < $arrCount) {
18        }
19
20        return $result;
21    }
22}
23?>