3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_cyclic(&$array) { $isRecursive = false; set_error_handler(function ($errno, $errstr) use (&$isRecursive) { $isRecursive = $errno === E_WARNING && mb_stripos($errstr, 'recursion'); }); try { count($array, COUNT_RECURSIVE); } finally { restore_error_handler(); } return $isRecursive; } $array = [1, [2, 3]]; $array[1][1] = &$array; var_dump(is_cyclic($array));

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0120.00318.43
8.3.50.0000.01516.54
8.3.40.0120.00318.96
8.3.30.0190.00018.56
8.3.20.0070.00024.18
8.3.10.0070.00024.66
8.3.00.0070.00026.16
8.2.180.0070.01125.92
8.2.170.0080.00819.06
8.2.160.0030.01322.96
8.2.150.0040.00425.66
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00421.02
8.2.110.0030.01522.32
8.2.100.0070.00717.85
8.2.90.0040.00417.89
8.2.80.0020.00519.47
8.2.70.0030.00617.63
8.2.60.0030.00519.35
8.2.50.0000.00818.05
8.2.40.0030.00618.34
8.2.30.0070.00018.16
8.2.20.0040.00418.13
8.2.10.0000.00819.31
8.2.00.0000.00719.38
8.1.280.0000.01425.92
8.1.270.0000.00724.66
8.1.260.0050.00526.35
8.1.250.0050.00328.09
8.1.240.0030.00623.92
8.1.230.0110.00022.59
8.1.220.0030.00517.93
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0000.00718.96
8.1.160.0000.00818.92
8.1.150.0000.00818.90
8.1.140.0000.00818.90
8.1.130.0040.00417.52
8.1.120.0000.00717.51
8.1.110.0000.00817.41
8.1.100.0030.00517.37
8.1.90.0070.00017.42
8.1.80.0030.00517.59
8.1.70.0030.00317.54
8.1.60.0040.00417.72
8.1.50.0000.00817.52
8.1.40.0100.00017.57
8.1.30.0030.00617.56
8.1.20.0090.00017.61
8.1.10.0030.00617.49
8.1.00.0030.00517.55
8.0.300.0060.00322.07
8.0.290.0060.00416.63
8.0.280.0030.00318.47
8.0.270.0030.00318.20
8.0.260.0040.00416.87
8.0.250.0030.00617.11
8.0.240.0000.00716.98
8.0.230.0030.00316.98
8.0.220.0040.00417.06
8.0.210.0030.00517.06
8.0.200.0030.00316.96
8.0.190.0000.00717.10
8.0.180.0000.00716.96
8.0.170.0070.00316.91
8.0.160.0070.00017.10
8.0.150.0000.00817.03
8.0.140.0060.00316.99
8.0.130.0000.00613.52
8.0.120.0050.00316.85
8.0.110.0080.00016.89
8.0.100.0000.00716.89
8.0.90.0000.00717.00
8.0.80.0080.01017.01
8.0.70.0040.00417.08
8.0.60.0000.00817.09
8.0.50.0040.00417.08
8.0.30.0090.00917.03
8.0.20.0160.00317.35
8.0.10.0000.00816.98
8.0.00.0150.00517.86
7.4.330.0000.00515.55
7.4.320.0000.00816.69
7.4.300.0070.00016.61
7.4.290.0050.00316.42
7.4.280.0000.00816.57
7.4.270.0000.00716.67
7.4.260.0030.00313.39
7.4.250.0040.00416.55
7.4.240.0040.00416.65
7.4.230.0000.00816.57
7.4.220.0020.00516.71
7.4.210.0050.01116.66
7.4.200.0070.00016.77
7.4.140.0120.00617.86
7.4.130.0260.01117.86
7.4.120.0260.01117.86
7.4.110.0330.00717.86
7.4.100.0180.01817.86
7.4.90.0280.00917.86
7.4.80.0230.01117.86
7.4.70.0300.00717.86
7.4.60.0230.01217.86
7.4.50.0310.00617.86
7.4.40.0290.01217.86
7.4.30.0180.01917.86
7.4.20.0380.00317.86
7.4.10.0220.01217.86
7.4.00.0300.00717.86
7.3.330.0030.00616.52
7.3.320.0000.00513.48
7.3.310.0070.00016.52
7.3.300.0030.00316.48
7.3.290.0070.00916.50
7.3.260.0190.01917.86
7.3.250.0330.00317.86
7.3.240.0340.01017.86
7.3.230.0270.01317.86
7.3.220.0270.01017.86
7.3.210.0370.00017.86
7.3.200.0210.01717.86
7.3.190.0310.00417.86
7.3.180.0310.00617.86
7.3.170.0870.00717.86
7.3.160.0300.01117.86
7.3.150.0280.01617.86
7.3.140.0290.00817.86
7.3.130.0290.01117.86
7.3.120.0240.01417.86
7.3.110.0270.01017.86
7.3.100.0290.00617.86
7.3.90.0240.01417.86
7.3.80.0270.01017.86
7.3.70.0290.01017.86
7.3.60.0290.00317.86
7.3.50.0270.00817.86
7.3.40.0320.00317.86
7.3.30.0220.01217.86
7.3.20.0230.01017.86
7.3.10.0270.01117.86
7.3.00.0360.00417.86

preferences:
59.82 ms | 401 KiB | 5 Q