3v4l.org

run code in 300+ PHP versions simultaneously
<?php // A unit testing framework in a tweet. https://gist.github.com/mathiasverraes/9046427 function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} function consistsOfTheSameValues(array $a, array $b) { // check size of both arrays if (count($a) !== count($b)) { return false; } foreach ($b as $key => $bValue) { // check that expected value exists in the array if (!in_array($bValue, $a, true)) { return false; } // check that expected value occurs the same amount of times in both arrays if (count(array_keys($a, $bValue, true)) !== count(array_keys($b, $bValue, true))) { return false; } } return true; } it('consist of the same values', consistsOfTheSameValues([1], [1]) === true ); it('consist of the same values', consistsOfTheSameValues([1, 1], [1, 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['1', 1], ['1', 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['1', 1], [1, '1']) === true ); it('consist of the same values', consistsOfTheSameValues([1, '1'], ['1', 1]) === true ); it('consist of the same values', consistsOfTheSameValues([1, '1'], [1, '1']) === true ); it('consist of the same values', consistsOfTheSameValues(['x' => 1], ['x' => 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['x' => 1], ['y' => 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['y' => 1], ['x' => 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['x' => 1, 'y' => 1], ['x' => 1, 'y' => 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['y' => 1, 'x' => 1], ['x' => 1, 'y' => 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['x' => 1, 'y' => 1], ['y' => 1, 'x' => 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['y' => 1, 'x' => 1], ['y' => 1, 'x' => 1]) === true ); it('consist of the same values', consistsOfTheSameValues(['x' => 2, 'y' => 1], ['x' => 1, 'y' => 2]) === true ); it('does not consist of the same values', consistsOfTheSameValues([1], [2]) === false ); it('does not consist of the same values', consistsOfTheSameValues(['1'], [1]) === false ); it('does not consist of the same values', consistsOfTheSameValues([1], ['1']) === false ); it('does not consist of the same values', consistsOfTheSameValues([1], [1, 1]) === false ); it('does not consist of the same values', consistsOfTheSameValues([1, 1], [1]) === false ); it('does not consist of the same values', consistsOfTheSameValues(['1', 1], [1, 1]) === false ); it('does not consist of the same values', consistsOfTheSameValues([1, '1'], [1, 1]) === false ); it('does not consist of the same values', consistsOfTheSameValues([1, 1], ['1', 1]) === false ); it('does not consist of the same values', consistsOfTheSameValues([1, 1], [1, '1']) === false ); it('does not consist of the same values', consistsOfTheSameValues(['1', '1'], [1, 1]) === false ); it('does not consist of the same values', consistsOfTheSameValues(['1', '1'], ['1', 1]) === false ); it('does not consist of the same values', consistsOfTheSameValues(['1', '1'], [1, '1']) === false ); it('does not consist of the same values', consistsOfTheSameValues([1, 1], ['1', '1']) === false ); it('does not consist of the same values', consistsOfTheSameValues(['1', 1], ['1', '1']) === false ); it('does not consist of the same values', consistsOfTheSameValues([1, '1'], ['1', '1']) === false ); it('does not consist of the same values', consistsOfTheSameValues(['x' => 1], ['x' => 2]) === false ); it('does not consist of the same values', consistsOfTheSameValues(['x' => 1, 'y' => 1], ['x' => 1, 'y' => 2]) === false ); it('does not consist of the same values', consistsOfTheSameValues(['x' => 1, 'y' => 1], ['x' => 2, 'y' => 1]) === false ); it('does not consist of the same values', consistsOfTheSameValues(['x' => 2, 'y' => 1], ['x' => 1, 'y' => 1]) === false );

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.4.20.0070.00717.96
8.4.10.0070.01317.57
8.3.150.0140.00416.76
8.3.140.0130.00616.76
8.3.130.0090.00318.29
8.3.120.0170.00717.71
8.3.110.0230.00818.69
8.3.100.0270.00416.44
8.3.90.0210.00821.61
8.3.80.0240.00517.33
8.3.70.0160.00517.64
8.3.60.0200.00517.49
8.3.50.0120.00820.15
8.3.40.0110.00718.06
8.3.30.0100.00617.94
8.3.20.0090.00618.28
8.3.10.0140.01119.50
8.3.00.0140.01018.25
8.2.270.0030.00617.03
8.2.260.0050.00320.50
8.2.250.0170.00516.52
8.2.240.0180.00916.75
8.2.230.0190.00719.48
8.2.220.0180.00516.58
8.2.210.0150.00621.60
8.2.200.0190.00617.75
8.2.190.0230.00516.54
8.2.180.0170.01016.65
8.2.170.0250.00820.25
8.2.160.0350.00518.35
8.2.150.0190.00720.79
8.2.140.0180.00521.11
8.2.130.0180.00519.11
8.2.120.0160.01021.88
8.2.110.0210.00919.89
8.2.100.0270.00218.59
8.2.90.0150.01218.43
8.2.80.0140.01017.70
8.2.70.0200.00417.32
8.2.60.0160.00417.72
8.2.50.0170.00617.71
8.2.40.0230.00419.90
8.2.30.0070.00618.48
8.2.20.0050.00817.58
8.2.10.0120.00917.78
8.2.00.0160.00717.85
8.1.310.0120.00318.45
8.1.300.0180.00317.26
8.1.290.0120.00623.51
8.1.280.0140.00621.06
8.1.270.0180.00820.57
8.1.260.0180.00622.72
8.1.250.0190.00322.78
8.1.240.0160.00719.16
8.1.230.0130.00417.71
8.1.220.0060.00717.58
8.1.210.0100.00218.08
8.1.200.0090.00417.32
8.1.190.0090.00417.18
8.1.180.0090.00317.71
8.1.170.0160.00217.99
8.1.160.0140.00418.25
8.1.150.0150.00418.15
8.1.140.0100.00418.48
8.1.130.0090.00517.62
8.1.120.0140.00617.49
8.1.110.0160.00317.45
8.1.100.0100.00717.47
8.1.90.0190.00317.37
8.1.80.0170.00617.44
8.1.70.0140.00717.51
8.1.60.0200.00517.44
8.1.50.0160.00717.40
8.1.40.0220.00417.49
8.1.30.0130.00417.52
8.1.20.0090.00617.55
8.1.10.0170.00417.47
8.1.00.0160.00417.43
8.0.300.0160.00417.74
8.0.290.0160.00916.73
8.0.280.0150.00717.50
8.0.270.0160.00616.76
8.0.260.0190.00416.88
8.0.250.0210.00316.77
8.0.240.0180.00516.86
8.0.230.0170.00616.91
8.0.220.0160.00716.84
8.0.210.0170.01116.81
8.0.200.0160.00716.89
8.0.190.0170.00516.95
8.0.180.0170.00616.86
8.0.170.0160.00816.81
8.0.160.0150.00716.88
8.0.150.0140.00616.73
8.0.140.0200.00216.80
8.0.130.0110.00815.04
8.0.120.0180.00516.77
8.0.110.0180.00416.82
8.0.100.0170.00516.80
8.0.90.0180.00316.63
8.0.80.0160.00916.74
8.0.70.0140.00616.80
8.0.60.0100.00316.77
8.0.50.0100.00116.89
8.0.30.0150.00716.95
8.0.20.0160.01017.24
8.0.10.0100.01017.02
8.0.00.0230.00516.83
7.4.330.0170.00415.71
7.4.320.0170.00516.53
7.4.300.0110.00716.61
7.4.290.0120.00716.42
7.4.280.0130.00716.49
7.4.270.0160.00616.61
7.4.260.0190.00316.48
7.4.250.0180.00216.56
7.4.240.0110.00816.47
7.4.230.0220.00416.46
7.4.220.0210.00716.49
7.4.210.0160.00916.58
7.4.200.0150.00516.46
7.4.190.0280.00816.54
7.4.180.0310.00316.35
7.4.160.0220.00516.52
7.4.150.0170.01016.97
7.4.140.0150.00817.36
7.4.130.0160.00816.53
7.4.120.0150.00716.42
7.4.110.0200.00616.48
7.4.100.0120.01016.58
7.4.90.0230.00416.44
7.4.80.0170.01017.79
7.4.70.0150.00816.36
7.4.60.0170.00816.40
7.4.50.0210.00616.33
7.4.40.0160.01016.38
7.4.30.0180.00816.52
7.4.20.0210.00616.38
7.4.10.0150.00816.42
7.4.00.0150.00515.94
7.3.330.0080.00314.77
7.3.320.0090.00214.86
7.3.310.0140.00216.29
7.3.300.0140.00216.39
7.3.290.0120.00016.43
7.3.280.0120.00516.47
7.3.270.0170.00916.79
7.3.260.0180.00716.37
7.3.250.0110.01116.48
7.3.240.0150.01016.43
7.3.230.0160.01116.40
7.3.220.0170.01716.18
7.3.210.0140.01116.42
7.3.200.0150.01316.51
7.3.190.0220.00416.35
7.3.180.0160.01316.41
7.3.170.0200.00616.39
7.3.160.0200.00516.49
7.3.150.0220.01216.41
7.3.140.0290.00516.18
7.3.130.0190.00916.28
7.3.120.0150.00516.32
7.3.110.0140.00816.44
7.3.100.0130.00616.30
7.3.90.0120.00916.38
7.3.80.0130.00316.41
7.3.70.0150.00616.45
7.3.60.0160.00716.41
7.3.50.0170.00716.35
7.3.40.0090.00916.36
7.3.30.0130.00716.42
7.3.20.0150.00818.10
7.3.10.0160.00718.14
7.3.00.0180.00718.23
7.2.340.0210.01116.24
7.2.330.0180.00816.39
7.2.320.0230.00616.52
7.2.310.0210.00616.44
7.2.300.0200.00916.44
7.2.290.0170.00816.58
7.2.280.0270.00816.18
7.2.270.0280.00916.30
7.2.260.0200.00916.46
7.2.250.0180.00616.43
7.2.240.0180.00616.52
7.2.230.0140.01016.48
7.2.220.0180.00316.59
7.2.210.0130.01016.44
7.2.200.0100.01316.72
7.2.190.0150.01016.43
7.2.180.0090.00816.45
7.2.170.0150.00716.56
7.2.160.0170.01016.63
7.2.150.0120.01018.27
7.2.140.0160.00518.23
7.2.130.0190.00518.25
7.2.120.0190.00718.19
7.2.110.0190.00718.08
7.2.100.0160.01018.22
7.2.90.0160.00518.18
7.2.80.0170.00418.38
7.2.70.0150.00818.26
7.2.60.0130.00917.86
7.2.50.0110.00718.34
7.2.40.0080.00718.39
7.2.30.0090.00418.21
7.2.20.0110.00818.36
7.2.10.0190.00718.34
7.2.00.0090.01218.67
7.1.330.0130.00817.40
7.1.320.0170.00617.32
7.1.310.0140.00417.20
7.1.300.0130.01017.36
7.1.290.0150.00817.30
7.1.280.0170.00317.36
7.1.270.0160.00617.28
7.1.260.0110.01017.24
7.1.250.0150.00417.14
7.1.240.0150.00517.11
7.1.230.0160.00517.22
7.1.220.0090.00217.32
7.1.210.0150.00717.18
7.1.200.0120.00616.72
7.1.190.0100.00917.28
7.1.180.0100.00717.21
7.1.170.0140.00617.23
7.1.160.0150.00617.23
7.1.150.0170.00517.13
7.1.140.0260.00517.15
7.1.130.0160.00517.30
7.1.120.0110.00917.22
7.1.110.0170.00217.23
7.1.100.0120.00717.50
7.1.90.0160.00517.19
7.1.80.0190.00817.21
7.1.70.0100.00917.18
7.1.60.0140.01018.03
7.1.50.0130.01017.29
7.1.40.0150.00717.21
7.1.30.0180.00717.23
7.1.20.0130.00817.07
7.1.10.0130.00817.18
7.1.00.0120.03018.77
7.0.330.0170.00616.71
7.0.320.0150.00716.80
7.0.310.0140.00617.03
7.0.300.0140.00716.75
7.0.290.0140.01016.79
7.0.280.0120.00916.73
7.0.270.0110.00717.05
7.0.260.0100.00916.76
7.0.250.0080.01117.04
7.0.240.0120.00817.00
7.0.230.0130.00616.80
7.0.220.0190.00416.75
7.0.210.0140.00916.87
7.0.200.0130.00716.38
7.0.190.0180.00516.85
7.0.180.0080.01216.96
7.0.170.0150.00616.87
7.0.160.0140.00916.92
7.0.150.0180.00516.92
7.0.140.0140.00716.91
7.0.130.0170.00516.83
7.0.120.0150.00716.99
7.0.110.0180.00316.67
7.0.100.0140.02217.90
7.0.90.0130.02417.90
7.0.80.0150.03317.95
7.0.70.0120.02117.91
7.0.60.0110.03418.06
7.0.50.0110.02418.05
7.0.40.0090.01717.25
7.0.30.0080.03017.27
7.0.20.0070.01917.18
7.0.10.0070.03317.20
7.0.00.0100.03417.35
5.6.400.0110.00616.07
5.6.390.0090.01216.00
5.6.380.0120.00416.09
5.6.370.0140.00616.04
5.6.360.0140.00816.13
5.6.350.0150.00415.98
5.6.340.0120.01216.10
5.6.330.0130.00816.06
5.6.320.0130.00815.92
5.6.310.0200.00516.04
5.6.300.0160.00616.15
5.6.290.0140.00516.14
5.6.280.0130.02917.78
5.6.270.0140.00915.96
5.6.260.0140.00916.10
5.6.250.0120.01317.71
5.6.240.0120.01917.54
5.6.230.0150.02717.59
5.6.220.0090.03517.59
5.6.210.0090.01617.51
5.6.200.0090.03317.74
5.6.190.0070.02317.76
5.6.180.0090.02517.74
5.6.170.0120.03017.71
5.6.160.0130.02717.77
5.6.150.0090.03017.67
5.6.140.0140.02317.70
5.6.130.0070.03217.77
5.6.120.0120.02917.71
5.6.110.0150.01717.72
5.6.100.0120.01917.76
5.6.90.0140.02517.69
5.6.80.0140.01517.53
5.6.70.0130.03217.47
5.6.60.0140.02617.45
5.6.50.0130.01717.49
5.6.40.0060.03617.47
5.6.30.0130.02017.45
5.6.20.0110.02317.54
5.6.10.0120.03017.53
5.6.00.0110.02217.47
5.5.380.0120.01917.50
5.5.370.0100.03517.57
5.5.360.0110.02117.43
5.5.350.0090.03017.42
5.5.340.0140.01817.56
5.5.330.0100.01617.65
5.5.320.0100.01717.63
5.5.310.0090.01717.61
5.5.300.0070.03217.58
5.5.290.0150.02117.61
5.5.280.0120.02517.67
5.5.270.0060.02017.63
5.5.260.0050.03017.63
5.5.250.0110.02817.60
5.5.240.0110.03417.48
5.5.230.0110.03417.42
5.5.220.0110.01617.47
5.5.210.0100.02517.42
5.5.200.0080.01917.33
5.5.190.0120.03017.42
5.5.180.0060.03917.33
5.5.170.0160.00615.99
5.5.160.0120.03017.46
5.5.150.0120.01717.47
5.5.140.0110.03017.30
5.5.130.0080.02117.30
5.5.120.0160.02417.40
5.5.110.0130.02117.35
5.5.100.0060.02717.38
5.5.90.0140.02617.43
5.5.80.0130.02717.42
5.5.70.0060.02217.27
5.5.60.0050.01917.40
5.5.50.0120.02417.40
5.5.40.0070.02917.34
5.5.30.0150.02017.40
5.5.20.0110.03017.38
5.5.10.0150.02817.33
5.5.00.0120.02017.31

preferences:
30.49 ms | 403 KiB | 5 Q