3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * The example shows how to pause the timer for measuring time at different stages. * Once watch is started, we can call `pause` method to pause the watch. * If watch is paused, we can start it again to start timer. In that case, time will be added to timer. */ // Load Composer auto loader require_once "../vendor/autoload.php"; use Phpreboot\Stopwatch\StopWatch; // Create an instance of StopWatch $stopWatch = new StopWatch(); $innerIterator = 0; for ($i = 1; $i <= 10; $i++) { printf("Iteration %d starting.\n", $i); $stopWatch->start(); for ($j = 0; $j < 1000; $j++) { $innerIterator++; } $stopWatch->pause(); printf("Iteration %d watch stopped, not other task is starting..\n", $i); for ($k = 0; $k < 1000; $k++) { $timeWaster = $k; } } printf("Time taken by first loop (\$j), for %d iterations was: %f seconds.\n", $innerIterator, $stopWatch->getTime());

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.0080.01116.63
8.3.50.0090.00621.93
8.3.40.0150.00018.84
8.3.30.0040.01118.80
8.3.20.0040.00420.25
8.3.10.0090.00021.90
8.3.00.0050.00323.60
8.2.180.0120.00616.88
8.2.170.0140.00722.96
8.2.160.0070.00721.02
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00420.78
8.2.120.0040.00426.35
8.2.110.0090.00020.90
8.2.100.0090.00317.93
8.2.90.0040.00419.02
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0050.00317.80
8.2.50.0030.00518.09
8.2.40.0030.00522.16
8.2.30.0050.00319.39
8.2.20.0050.00317.67
8.2.10.0000.00717.98
8.2.00.0050.00318.15
8.1.280.0090.00625.92
8.1.270.0050.00322.19
8.1.260.0080.00028.09
8.1.250.0000.00828.09
8.1.240.0000.01019.28
8.1.230.0070.00417.82
8.1.220.0030.00617.74
8.1.210.0080.00018.77
8.1.200.0000.00917.13
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0040.00418.53
8.1.160.0020.00520.74
8.1.150.0030.00518.78
8.1.140.0030.00619.46
8.1.130.0070.00017.59
8.1.120.0060.00317.43
8.1.110.0020.00517.41
8.1.100.0000.00817.33
8.1.90.0000.00817.44
8.1.80.0040.00317.44
8.1.70.0030.00317.30
8.1.60.0000.00817.63
8.1.50.0060.00317.45
8.1.40.0000.00817.51
8.1.30.0080.00017.73
8.1.20.0000.00717.64
8.1.10.0030.00517.57
8.1.00.0000.00717.55
8.0.300.0030.00518.77
8.0.290.0080.00016.88
8.0.280.0080.00018.57
8.0.270.0030.00317.24
8.0.260.0000.00717.35
8.0.250.0040.00417.15
8.0.240.0070.00017.02
8.0.230.0000.00717.02
8.0.220.0090.00017.10
8.0.210.0040.00417.02
8.0.200.0040.00417.10
8.0.190.0060.00317.12
8.0.180.0050.00217.03
8.0.170.0000.00817.07
8.0.160.0040.00417.02
8.0.150.0000.00816.89
8.0.140.0000.00716.92
8.0.130.0030.00313.49
8.0.120.0040.00417.07
8.0.110.0040.00417.05
8.0.100.0040.00417.04
8.0.90.0040.00416.92
8.0.80.0160.00317.09
8.0.70.0040.00416.86
8.0.60.0040.00417.09
8.0.50.0040.00416.89
8.0.30.0100.00817.17
8.0.20.0130.00617.40
8.0.10.0050.00317.05
8.0.00.0110.00716.84
7.4.330.0050.00016.82
7.4.320.0030.00316.62
7.4.300.0030.00316.43
7.4.290.0040.00416.61
7.4.280.0040.00416.63
7.4.270.0000.00816.61
7.4.260.0060.00316.55
7.4.250.0070.00016.54
7.4.240.0000.00816.55
7.4.230.0000.00716.70
7.4.220.0070.01816.62
7.4.210.0030.01416.65
7.4.200.0050.00216.60
7.4.160.0130.00316.42
7.4.150.0110.00717.40
7.4.140.0110.01117.86
7.4.130.0050.01216.53
7.4.120.0070.01316.50
7.4.110.0170.00016.65
7.4.100.0130.00416.59
7.4.90.0110.00816.55
7.4.80.0060.01619.39
7.4.70.0130.00316.38
7.4.60.0030.01416.39
7.4.50.0090.00616.12
7.4.40.0100.00616.39
7.4.30.0130.00316.68
7.4.00.0050.01015.08
7.3.330.0030.00313.14
7.3.320.0030.00313.12
7.3.310.0040.00416.38
7.3.300.0040.00216.29
7.3.290.0030.00316.29
7.3.280.0080.00816.29
7.3.270.0000.01717.40
7.3.260.0070.01016.43
7.3.250.0090.01016.36
7.3.240.0120.00816.34
7.3.230.0030.01316.39
7.3.210.0120.00616.34
7.3.200.0150.01019.39
7.3.190.0140.00616.32
7.3.180.0090.01316.36
7.3.170.0070.01016.46
7.3.160.0060.01116.18
7.3.120.0110.00414.89
7.3.110.0110.00715.02
7.3.100.0030.00614.93
7.3.90.0080.00314.81
7.3.80.0070.00714.87
7.3.70.0060.00614.77
7.3.60.0030.01014.73
7.3.50.0000.01414.44
7.3.40.0120.00614.51
7.3.30.0090.00314.75
7.3.20.0060.00316.74
7.3.10.0070.00716.35
7.3.00.0070.00716.32
7.2.330.0120.00616.59
7.2.320.0150.00316.36
7.2.310.0100.01416.46
7.2.300.0100.00716.39
7.2.290.0100.00716.50
7.2.250.0030.01614.77
7.2.240.0100.01014.80
7.2.230.0060.00915.02
7.2.220.0000.01414.73
7.2.210.0070.00714.82
7.2.200.0100.00314.91
7.2.190.0040.01115.07
7.2.180.0060.01214.77
7.2.170.0190.00015.04
7.2.80.0080.00516.25
7.2.60.0000.01416.70
7.2.00.0040.00819.30
7.1.330.0090.00615.72
7.1.320.0080.00415.79
7.1.310.0040.01115.92
7.1.300.0030.01415.49
7.1.290.0060.00915.59
7.1.280.0030.00915.71
7.1.270.0000.01415.70
7.1.260.0110.00415.51
7.1.200.0060.00615.65
7.1.100.0060.00917.98
7.1.70.0000.01017.01
7.1.60.0090.01519.40
7.1.50.0030.01716.51
7.1.00.0030.07722.34
7.0.200.0030.00616.46
7.0.60.0170.07321.77
7.0.50.0100.08017.68
7.0.40.0030.04320.07
7.0.30.0230.08720.04
7.0.20.0230.04320.17
7.0.10.0030.06720.32
7.0.00.0030.06720.00
5.6.280.0000.04021.07
5.6.210.0030.04720.46
5.6.200.0030.06318.14
5.6.190.0000.05720.64
5.6.180.0200.04320.64
5.6.170.0330.07020.47
5.6.160.0100.07720.34
5.6.150.0100.08018.23
5.6.140.0070.08018.08
5.6.130.0000.06018.22
5.6.120.0170.07020.99
5.6.110.0070.07321.09
5.6.100.0070.07721.09
5.6.90.0070.04720.98
5.6.80.0070.08720.39
5.5.350.0200.07020.38
5.5.340.0100.06018.02
5.5.330.0070.07020.57
5.5.320.0470.03020.22
5.5.310.0330.05320.25
5.5.300.0070.05717.92
5.5.290.0070.04717.99
5.5.280.0170.06020.84
5.5.270.0000.04320.95
5.5.260.0070.08320.72
5.5.250.0130.07320.59
5.5.240.0170.03020.04

preferences:
51.01 ms | 401 KiB | 5 Q