3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = new SplTempFileObject(); for ($i = 0; $i < 100; $i++) { $file->fwrite("Foo $i\n"); } $file->rewind(); print_r(array( array('line' => $file->key(), 'contents' => trim($file->fgets())), array('line' => $file->key(), 'contents' => trim($file->fgets())), array('line' => $file->key(), 'contents' => trim($file->fgets())), )); $file->seek(50); print_r(array( array('line' => $file->key(), 'contents' => trim($file->fgets())), array('line' => $file->key(), 'contents' => trim($file->fgets())), array('line' => $file->key(), 'contents' => trim($file->fgets())), ));

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.120.0080.00822.32
8.4.110.0120.00822.38
8.4.100.0020.00617.93
8.4.90.0110.00818.72
8.4.80.0150.00517.70
8.4.70.0120.00818.02
8.4.60.0150.00724.20
8.4.50.0050.00420.43
8.4.40.0140.00317.74
8.4.30.0080.00020.62
8.4.20.0070.01319.75
8.4.10.0090.00019.66
8.3.250.0050.00418.88
8.3.240.0100.00916.73
8.3.230.0100.00816.34
8.3.220.0140.00417.17
8.3.210.0140.00418.44
8.3.200.0040.00516.55
8.3.190.0090.00916.97
8.3.180.0100.01116.73
8.3.170.0160.00317.26
8.3.160.0130.00618.32
8.3.150.0120.00618.27
8.3.140.0080.00017.28
8.3.130.0030.00718.49
8.3.120.0040.00419.00
8.3.110.0030.00520.94
8.3.100.0070.00416.39
8.3.90.0090.00626.77
8.3.80.0090.00016.63
8.3.70.0100.01016.58
8.3.60.0080.00816.36
8.3.50.0180.00419.95
8.3.40.0080.00819.17
8.3.30.0090.00918.67
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0080.00520.33
8.2.280.0100.00518.45
8.2.270.0120.00317.10
8.2.260.0080.00016.35
8.2.250.0040.00418.10
8.2.240.0070.00318.92
8.2.230.0100.00022.58
8.2.220.0090.00024.06
8.2.210.0040.00426.77
8.2.200.0030.00616.75
8.2.190.0140.00316.88
8.2.180.0090.00925.92
8.2.170.0060.00919.09
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0050.00326.16
8.2.120.0030.00526.16
8.2.110.0060.00322.18
8.2.100.0090.00317.78
8.2.90.0080.00319.63
8.2.80.0000.00818.03
8.2.70.0050.00317.93
8.2.60.0040.00418.16
8.2.50.0080.00018.10
8.2.40.0070.00019.48
8.2.30.0040.00417.91
8.2.20.0040.00419.45
8.2.10.0000.00717.66
8.2.00.0000.00819.26
8.1.330.0120.00721.98
8.1.320.0100.00916.29
8.1.310.0040.00418.41
8.1.300.0070.00720.30
8.1.290.0030.00630.84
8.1.280.0030.01225.92
8.1.270.0090.00021.98
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0100.00317.39
8.1.230.0040.00820.88
8.1.220.0060.00317.74
8.1.210.0000.00818.99
8.1.200.0040.00417.22
8.1.190.0080.00017.22
8.1.180.0000.00918.10
8.1.170.0000.00918.47
8.1.160.0040.00422.59
8.1.150.0040.00418.60
8.1.140.0040.00417.44
8.1.130.0070.00019.00
8.1.120.0000.00717.52
8.1.110.0050.00217.48
8.1.100.0040.00417.39
8.1.90.0000.00817.37
8.1.80.0110.00017.49
8.1.70.0070.00017.50
8.1.60.0050.00317.57
8.1.50.0040.00417.46
8.1.40.0080.00017.55
8.1.30.0060.00317.70
8.1.20.0070.00017.75
8.1.10.0040.00417.67
8.1.00.0040.00417.40
8.0.300.0000.00719.82
8.0.290.0060.00616.88
8.0.280.0030.00318.07
8.0.270.0080.00016.91
8.0.260.0000.00818.49
8.0.250.0050.00317.02
8.0.240.0030.00616.90
8.0.230.0040.00416.89
8.0.220.0000.00716.98
8.0.210.0050.00216.81
8.0.200.0030.00317.00
8.0.190.0040.00416.99
8.0.180.0000.00717.01
8.0.170.0000.00817.00
8.0.160.0040.00417.03
8.0.150.0000.00816.90
8.0.140.0080.00416.90
8.0.130.0000.00813.30
8.0.120.0060.00416.88
8.0.110.0070.00216.93
8.0.100.0000.01016.86
8.0.90.0030.00616.87
8.0.80.0030.00716.86
8.0.70.0030.00616.84
8.0.60.0050.00416.86
8.0.50.0030.00616.86
8.0.30.0070.00216.77
8.0.20.0040.00616.85
8.0.10.0050.00416.99
8.0.00.0040.00417.00
7.4.330.0080.00015.55
7.4.320.0000.00616.62
7.4.300.0040.00416.57
7.4.290.0030.00516.58
7.4.280.0100.00016.69
7.4.270.0040.00416.66
7.4.260.0000.00613.44
7.4.250.0030.00516.58
7.4.240.0050.00516.57
7.4.230.0040.00516.57
7.4.220.0040.00616.44
7.4.210.0030.00616.50
7.4.200.0030.00616.57
7.4.190.0030.00616.49
7.4.180.0020.00716.63
7.4.160.0060.00316.63
7.4.150.0020.00616.51
7.4.140.0010.00816.47
7.4.130.0050.00316.45
7.4.120.0050.00316.45
7.4.110.0010.00816.39
7.4.100.0060.00416.55
7.4.90.0050.00516.40
7.4.80.0040.00616.48
7.4.70.0040.00516.56
7.4.60.0020.00716.49
7.4.50.0020.00616.41
7.4.40.0020.00616.42
7.4.30.0020.00716.52
7.4.20.0050.00316.45
7.4.10.0020.00616.40
7.4.00.0030.00616.55
7.3.330.0000.00716.44
7.3.320.0060.00013.23
7.3.310.0020.00616.39
7.3.300.0040.00416.27
7.3.290.0060.00316.31
7.3.280.0050.00316.36
7.3.270.0070.00116.43
7.3.260.0040.00416.28
7.3.250.0030.00516.28
7.3.240.0040.00416.23
7.3.230.0030.00616.28
7.3.220.0020.00616.35
7.3.210.0040.00516.16
7.3.200.0040.00516.26
7.3.190.0050.00516.28
7.3.180.0040.00616.22
7.3.170.0010.00716.19
7.3.160.0040.00516.08
7.3.150.0050.00416.18
7.3.140.0040.00416.09
7.3.130.0000.00916.20
7.3.120.0050.00416.30
7.3.110.0030.00516.14
7.3.100.0020.00716.15
7.3.90.0070.00216.55
7.3.80.0040.00516.20
7.3.70.0050.00416.45
7.3.60.0070.00216.37
7.3.50.0030.00516.39
7.3.40.0050.00416.40
7.3.30.0030.00616.24
7.3.20.0060.00417.43
7.3.10.0020.00717.33
7.3.00.0030.00617.13
7.2.340.0020.00816.40
7.2.330.0060.00516.39
7.2.320.0080.00216.39
7.2.310.0040.00516.42
7.2.300.0040.00516.50
7.2.290.0050.00516.48
7.2.280.0050.00516.34
7.2.270.0050.00516.27
7.2.260.0040.00516.48
7.2.250.0060.00416.52
7.2.240.0070.00216.31
7.2.230.0040.00516.26
7.2.220.0070.00316.46
7.2.210.0070.00316.30
7.2.200.0060.00316.60
7.2.190.0040.00616.51
7.2.180.0070.00416.50
7.2.170.0060.00416.65
7.2.160.0040.00616.52
7.2.150.0050.00517.55
7.2.140.0090.00717.56
7.2.130.0050.00617.70
7.2.120.0080.00317.54
7.2.110.0040.00617.57
7.2.100.0050.00617.58
7.2.90.0030.00717.45
7.2.80.0070.00417.55
7.2.70.0060.00417.46
7.2.60.0070.00417.41
7.2.50.0050.00517.36
7.2.40.0080.00417.63
7.2.30.0090.00217.57
7.2.20.0100.00617.59
7.2.10.0040.00617.54
7.2.00.0090.00217.40
7.1.330.0050.00516.47
7.1.320.0080.00216.33
7.1.310.0050.00516.33
7.1.300.0090.00316.30
7.1.290.0070.00516.33
7.1.280.0030.00616.50
7.1.270.0070.00316.33
7.1.260.0040.00616.26
7.1.250.0050.00416.22
7.1.240.0030.00416.21
7.1.230.0050.00316.38
7.1.220.0050.00316.32
7.1.210.0030.00516.22
7.1.200.0040.00416.26
7.1.190.0000.00916.40
7.1.180.0020.00616.34
7.1.170.0050.00316.37
7.1.160.0060.00216.32
7.1.150.0050.00616.25
7.1.140.0030.00516.24
7.1.130.0070.00216.18
7.1.120.0030.00516.33
7.1.110.0050.00316.32
7.1.100.0040.00416.24
7.1.90.0030.00516.17
7.1.80.0060.00516.36
7.1.70.0040.00516.08
7.1.60.0000.00916.39
7.1.50.0050.00316.45
7.1.40.0040.00416.37
7.1.30.0030.00616.31
7.1.20.0040.00516.41
7.1.10.0050.00416.28
7.1.00.0050.00316.23
7.0.330.0050.00316.07
7.0.320.0040.00416.10
7.0.310.0020.00616.04
7.0.300.0040.00416.07
7.0.290.0020.00616.00
7.0.280.0060.00316.05
7.0.270.0010.00716.02
7.0.260.0030.00616.12
7.0.250.0050.00416.08
7.0.240.0030.00516.22
7.0.230.0040.00416.13
7.0.220.0020.00616.12
7.0.210.0090.00316.11
7.0.200.0050.00316.00
7.0.190.0010.00616.08
7.0.180.0050.00316.14
7.0.170.0060.00216.25
7.0.160.0050.00315.95
7.0.150.0040.00516.05
7.0.140.0040.00416.08
7.0.130.0090.00016.10
7.0.120.0060.00316.04
7.0.110.0040.00616.05
7.0.100.0040.00516.07
7.0.90.0010.00716.06
7.0.80.0050.00315.99
7.0.70.0100.00015.98
7.0.60.0020.00716.11
7.0.50.0050.00316.05
7.0.40.0050.00316.04
7.0.30.0040.00416.11
7.0.20.0010.00716.03
7.0.10.0060.00216.14
7.0.00.0040.00416.10
5.6.400.0010.00615.75
5.6.390.0050.00315.75
5.6.380.0070.00215.80
5.6.370.0060.00215.66
5.6.360.0050.00315.67
5.6.350.0050.00415.77
5.6.340.0040.00515.83
5.6.330.0060.00215.74
5.6.320.0050.00315.70
5.6.310.0020.00715.74
5.6.300.0020.00615.63
5.6.290.0030.00515.75
5.6.280.0050.00315.71
5.6.270.0060.00415.64
5.6.260.0030.00515.73
5.6.250.0090.00015.78
5.6.240.0030.00515.88
5.6.230.0040.00415.93
5.6.220.0060.00215.93
5.6.210.0060.00415.80
5.6.200.0030.00615.88
5.6.190.0040.00415.96
5.6.180.0040.00515.80
5.6.170.0040.00415.96
5.6.160.0020.00715.86
5.6.150.0070.00215.88
5.6.140.0070.00215.79
5.6.130.0030.00515.93
5.6.120.0030.00515.89
5.6.110.0060.00315.88
5.6.100.0050.00315.91
5.6.90.0030.00515.77
5.6.80.0040.00415.77
5.6.70.0050.00315.96
5.6.60.0040.00515.94
5.6.50.0050.00515.77
5.6.40.0020.00715.82
5.6.30.0080.00115.78
5.6.20.0060.00315.89
5.6.10.0020.00615.82
5.6.00.0050.00415.78
5.5.380.0080.00315.77
5.5.370.0070.00515.86
5.5.360.0110.00015.75
5.5.350.0050.00615.80
5.5.340.0060.00515.73
5.5.330.0040.00615.77
5.5.320.0100.00115.63
5.5.310.0030.00915.74
5.5.300.0080.00415.73
5.5.290.0060.00715.67
5.5.280.0070.00415.70
5.5.270.0080.00315.90
5.5.260.0090.00315.79
5.5.250.0070.00515.77
5.5.240.0070.00415.91
5.5.230.0100.00215.71
5.5.220.0060.00715.74
5.5.210.0110.00015.85
5.5.200.0080.00415.59
5.5.190.0070.00515.74
5.5.180.0060.00515.58
5.5.170.0090.00215.79
5.5.160.0060.00615.72
5.5.150.0020.00915.55
5.5.140.0030.00815.52
5.5.130.0030.00815.38
5.5.120.0090.00515.49
5.5.110.0070.00615.55
5.5.100.0050.00615.78
5.5.90.0080.00515.89
5.5.80.0060.00615.76
5.5.70.0060.00515.81
5.5.60.0070.00415.78
5.5.50.0100.00115.68
5.5.40.0060.00515.67
5.5.30.0110.00115.84
5.5.20.0070.00515.90
5.5.10.0040.00715.70
5.5.00.0090.00215.70
5.4.450.0030.00612.68
5.4.440.0030.00512.82
5.4.430.0070.00112.66
5.4.420.0040.00412.52
5.4.410.0030.00512.71
5.4.400.0080.00112.49
5.4.390.0070.00212.66
5.4.380.0040.00512.61
5.4.370.0030.00712.43
5.4.360.0030.00512.69
5.4.350.0070.00312.52
5.4.340.0070.00412.69
5.4.330.0030.00612.50
5.4.320.0030.00612.61
5.4.310.0070.00112.58
5.4.300.0040.00412.71
5.4.290.0020.00612.57
5.4.280.0050.00412.67
5.4.270.0070.00112.65
5.4.260.0070.00312.55
5.4.250.0050.00512.53
5.4.240.0050.00212.55
5.4.230.0050.00412.44
5.4.220.0050.00312.47
5.4.210.0060.00212.38
5.4.200.0070.00012.44
5.4.190.0050.00212.41
5.4.180.0080.00012.53
5.4.170.0020.00612.38
5.4.160.0060.00212.55
5.4.150.0070.00012.63
5.4.140.0060.00212.63
5.4.130.0020.00612.63
5.4.120.0040.00412.71
5.4.110.0020.00512.62
5.4.100.0020.00412.56
5.4.90.0040.00412.73
5.4.80.0040.00512.90
5.4.70.0010.00612.71
5.4.60.0040.00312.79
5.4.50.0000.00812.62
5.4.40.0050.00212.55
5.4.30.0060.00212.90
5.4.20.0050.00212.86
5.4.10.0050.00212.80
5.4.00.0020.00512.65
5.3.290.0020.00613.06
5.3.280.0050.00513.05
5.3.270.0040.00413.16
5.3.260.0040.00413.00
5.3.250.0060.00313.08
5.3.240.0030.00413.05
5.3.230.0050.00412.93
5.3.220.0050.00412.93
5.3.210.0070.00113.01
5.3.200.0040.00513.06
5.3.190.0060.00413.14
5.3.180.0040.00713.03
5.3.170.0030.00713.04
5.3.160.0040.00613.01
5.3.150.0040.00713.12
5.3.140.0090.00212.94
5.3.130.0070.00313.11
5.3.120.0000.01113.20
5.3.110.0060.00512.93
5.3.100.0060.00413.05
5.3.90.0040.00513.09
5.3.80.0040.00612.85
5.3.70.0060.00512.82
5.3.60.0030.00713.15
5.3.50.0060.00413.08
5.3.40.0000.01012.97
5.3.30.0060.00313.11
5.3.20.0040.00512.91
5.3.10.0040.00512.84
5.3.00.0030.00612.83
5.2.170.0020.00712.07
5.2.160.0070.00212.00
5.2.150.0030.00612.20
5.2.140.0030.00512.02
5.2.130.0070.00111.79
5.2.120.0060.00311.96
5.2.110.0050.00311.94
5.2.100.0050.00411.96
5.2.90.0040.00411.99
5.2.80.0080.00111.85
5.2.70.0020.00611.93
5.2.60.0000.00911.78
5.2.50.0040.00311.88
5.2.40.0040.00311.99
5.2.30.0030.00511.83
5.2.20.0030.00511.74
5.2.10.0070.00011.66
5.2.00.0040.00311.76
5.1.60.0020.00411.14
5.1.50.0010.00611.14
5.1.40.0070.00111.14
5.1.30.0040.00311.16
5.1.20.0020.00611.14
5.1.10.0020.00411.14
5.1.00.0010.00611.14
5.0.50.0010.00411.14
5.0.40.0030.00311.14
5.0.30.0020.00411.14
5.0.20.0040.00311.14
5.0.10.0030.00311.14
5.0.00.0000.00611.14
4.4.90.0010.00311.14
4.4.80.0030.00111.14
4.4.70.0020.00211.14
4.4.60.0020.00211.14
4.4.50.0010.00311.14
4.4.40.0000.00411.14
4.4.30.0030.00111.14
4.4.20.0030.00111.14
4.4.10.0050.00011.14
4.4.00.0030.00211.14
4.3.110.0040.00011.14
4.3.100.0030.00111.14
4.3.90.0030.00111.14
4.3.80.0020.00311.14
4.3.70.0030.00211.14
4.3.60.0020.00211.14
4.3.50.0030.00111.14
4.3.40.0040.00011.14
4.3.30.0000.00311.14
4.3.20.0020.00211.14
4.3.10.0000.00311.14
4.3.00.0010.00211.14

preferences:
30.07 ms | 403 KiB | 5 Q