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(); $file->key(); $file->current(); function get_line($file) { $triggerNext = $file->next(); $return = array(); $return['line'] = $file->key(); $return['contents'] = trim($file->current()); return $return; } $array = []; $array[] = get_line($file); $array[] = get_line($file); $array[] = get_line($file); echo json_encode($array, JSON_PRETTY_PRINT);

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.70.0000.01516.63
8.3.60.0090.01218.56
8.3.50.0100.00719.89
8.3.40.0110.00419.27
8.3.30.0070.01318.71
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.190.0070.00718.17
8.2.180.0090.00625.92
8.2.170.0210.00019.13
8.2.160.0100.00322.96
8.2.150.0070.00025.66
8.2.140.0020.00524.66
8.2.130.0080.00026.16
8.2.120.0000.00726.16
8.2.110.0030.00621.04
8.2.100.0040.00817.91
8.2.90.0000.01019.89
8.2.80.0040.00420.59
8.2.70.0040.00417.63
8.2.60.0050.00317.75
8.2.50.0050.00317.63
8.2.40.0040.00420.01
8.2.30.0040.00418.03
8.2.20.0040.00419.50
8.2.10.0030.00517.87
8.2.00.0040.00419.43
8.1.280.0060.00925.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0080.00028.09
8.1.240.0080.00022.32
8.1.230.0040.00721.11
8.1.220.0040.00417.78
8.1.210.0040.00419.10
8.1.200.0000.00817.48
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00819.09
8.1.160.0040.00419.12
8.1.150.0040.00418.59
8.1.140.0040.00417.32
8.1.130.0000.00817.49
8.1.120.0050.00217.47
8.1.110.0000.00717.50
8.1.100.0040.00417.46
8.1.90.0080.00017.35
8.1.80.0040.00717.44
8.1.70.0030.00317.46
8.1.60.0030.00617.61
8.1.50.0040.00417.61
8.1.40.0080.00017.57
8.1.30.0000.00817.66
8.1.20.0030.00517.68
8.1.10.0000.01117.68
8.1.00.0040.00417.59
8.0.300.0000.00720.27
8.0.290.0070.00016.75
8.0.280.0030.00318.64
8.0.270.0070.00018.07
8.0.260.0070.00016.88
8.0.250.0070.00017.01
8.0.240.0000.00717.02
8.0.230.0000.00717.08
8.0.220.0040.00416.93
8.0.210.0030.00316.91
8.0.200.0050.00216.93
8.0.190.0030.00516.99
8.0.180.0070.00016.89
8.0.170.0060.00316.94
8.0.160.0040.00416.87
8.0.150.0070.00016.78
8.0.140.0040.00816.92
8.0.130.0000.00613.38
8.0.120.0030.00516.93
8.0.110.0040.00516.90
8.0.100.0010.00616.97
8.0.90.0030.00516.92
8.0.80.0080.00016.89
8.0.70.0040.00416.94
8.0.60.0020.00516.87
8.0.50.0050.00316.94
8.0.30.0050.00316.89
8.0.20.0060.00217.07
8.0.10.0050.00317.02
8.0.00.0020.00616.98
7.4.330.0040.00015.55
7.4.320.0030.00316.51
7.4.300.0040.00416.58
7.4.290.0080.00016.47
7.4.280.0030.00616.57
7.4.270.0000.00716.51
7.4.260.0060.00013.32
7.4.250.0030.00416.65
7.4.240.0000.00716.64
7.4.230.0060.00216.59
7.4.220.0020.00616.61
7.4.210.0060.00216.57
7.4.200.0040.00416.60
7.4.190.0040.00416.68
7.4.180.0050.00216.64
7.4.160.0060.00116.64
7.4.150.0030.00416.65
7.4.140.0000.00816.47
7.4.130.0040.00416.57
7.4.120.0000.00716.58
7.4.110.0000.00716.52
7.4.100.0060.00116.51
7.4.90.0020.00516.53
7.4.80.0040.00316.56
7.4.70.0020.00616.51
7.4.60.0040.00416.53
7.4.50.0070.00016.37
7.4.40.0030.00416.37
7.4.30.0000.00716.42
7.4.20.0020.00516.58
7.4.10.0060.00216.56
7.4.00.0050.00316.58
7.3.330.0040.00416.31
7.3.320.0030.00313.29
7.3.310.0050.00216.47
7.3.300.0030.00316.40
7.3.290.0020.00516.37
7.3.280.0020.00516.42
7.3.270.0020.00516.38
7.3.260.0030.00316.41
7.3.250.0030.00316.39
7.3.240.0020.00516.36
7.3.230.0040.00316.36
7.3.220.0030.00416.34
7.3.210.0020.00516.28
7.3.200.0000.00716.43
7.3.190.0020.00516.24
7.3.180.0030.00416.18
7.3.170.0020.00616.35
7.3.160.0030.00416.36
7.3.150.0030.00316.36
7.3.140.0060.00016.36
7.3.130.0040.00416.37
7.3.120.0060.00216.28
7.3.110.0020.00516.33
7.3.100.0030.00416.33
7.3.90.0070.00016.64
7.3.80.0030.00516.28
7.3.70.0020.00616.47
7.3.60.0030.00316.59
7.3.50.0020.00516.56
7.3.40.0020.00616.60
7.3.30.0040.00416.42
7.3.20.0040.00416.52
7.3.10.0050.00316.42
7.3.00.0080.00016.46
7.2.340.0040.00416.34
7.2.330.0000.00916.36
7.2.320.0040.00416.54
7.2.310.0070.00016.32
7.2.300.0050.00316.52
7.2.290.0070.00016.33
7.2.280.0030.00316.52
7.2.270.0000.00816.47
7.2.260.0080.00016.48
7.2.250.0000.00716.39
7.2.240.0030.00316.52
7.2.230.0030.00616.38
7.2.220.0000.00816.51
7.2.210.0040.00416.53
7.2.200.0030.00316.49
7.2.190.0030.00316.45
7.2.180.0040.00416.51
7.2.170.0050.00216.71
7.2.160.0030.00316.72
7.2.150.0050.00316.59
7.2.140.0040.00416.61
7.2.130.0050.00316.89
7.2.120.0020.00516.68
7.2.110.0000.00816.82
7.2.100.0040.00416.73
7.2.90.0040.00416.65
7.2.80.0040.00416.53
7.2.70.0080.00016.72
7.2.60.0080.00016.59
7.2.50.0040.00416.77
7.2.40.0020.00516.61
7.2.30.0080.00016.76
7.2.20.0080.00016.65
7.2.10.0040.00416.63
7.2.00.0040.00416.88
7.1.330.0050.00315.64
7.1.320.0030.00315.66
7.1.310.0030.00515.66
7.1.300.0030.00315.57
7.1.290.0030.00315.59
7.1.280.0070.00015.72
7.1.270.0080.00015.66
7.1.260.0000.00715.61
7.1.250.0080.00015.62
7.1.240.0020.00515.60
7.1.230.0050.00415.53
7.1.220.0040.00415.68
7.1.210.0040.00415.60
7.1.200.0030.00315.55
7.1.190.0040.00415.51
7.1.180.0000.00715.44
7.1.170.0050.00215.59
7.1.160.0040.00415.56
7.1.150.0130.00715.43
7.1.140.0030.00315.48
7.1.130.0220.00415.54
7.1.120.0000.00915.40
7.1.110.0050.00215.59
7.1.100.0040.00415.50
7.1.90.0030.00615.37
7.1.80.0000.00715.45
7.1.70.0050.00315.45
7.1.60.0020.00515.56
7.1.50.0060.00315.52
7.1.40.0040.00415.69
7.1.30.0030.00615.61
7.1.20.0030.00515.43
7.1.10.0050.00215.66
7.1.00.0050.00215.60
7.0.330.0020.00515.28
7.0.320.0060.00015.24
7.0.310.0000.00715.29
7.0.300.0020.00415.29
7.0.290.0000.00715.20
7.0.280.0070.00015.07
7.0.270.0100.00515.14
7.0.260.0030.00715.09
7.0.250.0080.00015.28
7.0.240.0020.00615.39
7.0.230.0030.00515.51
7.0.220.0090.00015.44
7.0.210.0050.00415.36
7.0.200.0070.00215.50
7.0.190.0040.00415.44
7.0.180.0050.00215.38
7.0.170.0000.00715.44
7.0.160.0030.00315.44
7.0.150.0000.00815.45
7.0.140.0050.00315.29
7.0.130.0080.00015.34
7.0.120.0080.00015.35
7.0.110.0070.00215.44
7.0.100.0060.00315.36
7.0.90.0000.00815.29
7.0.80.0090.00015.25
7.0.70.0080.00015.13
7.0.60.0090.00015.32
7.0.50.0180.00015.09
7.0.40.0020.00515.24
7.0.30.0030.00315.20
7.0.20.0030.00315.41
7.0.10.0050.00215.23
7.0.00.0000.00715.26
5.6.400.0000.00616.05
5.6.390.0050.00315.87
5.6.380.0040.00416.04
5.6.370.0040.00415.84
5.6.360.0060.00215.82
5.6.350.0000.00916.08
5.6.340.0000.00916.08
5.6.330.0000.00916.07
5.6.320.0000.00916.00
5.6.310.0050.00316.12
5.6.300.0000.00915.72
5.6.290.0080.00016.04
5.6.280.0000.00816.09
5.6.270.0050.00315.94
5.6.260.0080.00016.03
5.6.250.0000.00815.79
5.6.240.0080.00016.09
5.6.230.0040.00416.14
5.6.220.0030.00616.21
5.6.210.0040.00415.94
5.6.200.0020.00716.23
5.6.190.0030.00616.01
5.6.180.0040.00416.05
5.6.170.0080.00015.91
5.6.160.0100.00016.12
5.6.150.0080.00016.12
5.6.140.0040.00415.95
5.6.130.0090.00016.21
5.6.120.0100.00016.07
5.6.110.0090.00016.03
5.6.100.0090.00015.85
5.6.90.0000.00815.99
5.6.80.0080.00015.93
5.6.70.0080.00016.07
5.6.60.0040.00415.96
5.6.50.0080.00016.01
5.6.40.0040.00415.95
5.6.30.0030.00516.12
5.6.20.0000.00915.94
5.6.10.0030.00515.80
5.6.00.0030.00615.97
5.5.380.0050.00516.18
5.5.370.0040.00416.20
5.5.360.0020.00715.81
5.5.350.0060.00315.66
5.5.340.0000.00916.00
5.5.330.0070.00416.03
5.5.320.0050.00515.73
5.5.310.0000.00815.72
5.5.300.0040.00415.86
5.5.290.0040.00415.72
5.5.280.0080.00015.74
5.5.270.0070.00015.68
5.5.260.0060.00316.01
5.5.250.0090.00016.05
5.5.240.0030.00516.19
5.5.230.0050.00515.92
5.5.220.0040.00515.97
5.5.210.0060.00316.03
5.5.200.0030.00515.94
5.5.190.0030.00315.79
5.5.180.0000.00815.97
5.5.170.0080.00015.82
5.5.160.0040.00415.78
5.5.150.0070.00315.89
5.5.140.0050.00515.64
5.5.130.0050.00515.70
5.5.120.0100.00015.85
5.5.110.0030.00515.83
5.5.100.0050.00515.82
5.5.90.0000.00915.82
5.5.80.0020.00716.13
5.5.70.0090.00015.80
5.5.60.0040.00416.10
5.5.50.0090.00015.89
5.5.40.0090.00015.79
5.5.30.0060.00516.00
5.5.20.0090.00016.10
5.5.10.0000.00815.98
5.5.00.0050.00515.77
5.4.450.0080.00012.64
5.4.440.0060.00012.72
5.4.430.0050.00212.67
5.4.420.0000.00713.01
5.4.410.0000.00612.77
5.4.400.0040.00412.88
5.4.390.0020.00412.89
5.4.380.0090.00012.55
5.4.370.0030.00312.86
5.4.360.0030.00312.52
5.4.350.0080.00012.73
5.4.340.0040.00412.55
5.4.330.0040.00312.55
5.4.320.0000.00812.66
5.4.310.0050.00312.96
5.4.300.0040.00512.96
5.4.290.0050.00512.94
5.4.280.0040.00412.80
5.4.270.0030.00612.71
5.4.260.0080.00012.72
5.4.250.0000.00912.61
5.4.240.0060.00312.71
5.4.230.0000.00812.38
5.4.220.0060.00312.62
5.4.210.0060.00212.43
5.4.200.0080.00012.63
5.4.190.0000.00812.47
5.4.180.0030.00312.46
5.4.170.0080.00012.53
5.4.160.0000.00712.71
5.4.150.0030.00512.75
5.4.140.0020.00812.86
5.4.130.0080.00012.93
5.4.120.0040.00412.80
5.4.110.0000.00613.01
5.4.100.0000.00712.76
5.4.90.0020.00412.85
5.4.80.0070.00012.78
5.4.70.0060.00012.92
5.4.60.0040.00412.74
5.4.50.0030.00312.81
5.4.40.0050.00312.99
5.4.30.0070.00012.88
5.4.20.0000.00813.06
5.4.10.0070.00012.86
5.4.00.0040.00412.75
5.3.290.0070.00012.95
5.3.280.0000.00712.73
5.3.270.0030.00312.95
5.3.260.0000.00512.88
5.3.250.0000.00712.97
5.3.240.0030.00312.57
5.3.230.0030.00312.62
5.3.220.0040.00412.63
5.3.210.0030.00312.91
5.3.200.0030.00312.66
5.3.190.0000.00612.96
5.3.180.0030.00312.93
5.3.170.0030.00312.93
5.3.160.0000.00613.02
5.3.150.0000.00612.78
5.3.140.0060.00013.02
5.3.130.0000.00512.89
5.3.120.0050.00012.76
5.3.110.0000.00513.02
5.3.100.0050.00012.75
5.3.90.0000.00512.80
5.3.80.0030.00312.72
5.3.70.0060.00012.92
5.3.60.0050.00012.92
5.3.50.0030.00312.85
5.3.40.0030.00312.68
5.3.30.0050.00012.66
5.3.20.0060.00012.64
5.3.10.0000.00512.70
5.3.00.0020.00212.68
5.2.170.0030.00611.88
5.2.160.0040.00411.95
5.2.150.0000.00511.78
5.2.140.0000.00611.70
5.2.130.0000.00511.74
5.2.120.0030.00311.87
5.2.110.0030.00311.67
5.2.100.0030.00311.89
5.2.90.0000.00511.69
5.2.80.0000.00611.83
5.2.70.0030.00311.84
5.2.60.0030.00311.81
5.2.50.0000.00611.80
5.2.40.0000.00511.69
5.2.30.0020.00211.61
5.2.20.0000.00511.48
5.2.10.0030.00311.41
5.2.00.0020.00211.33
5.1.60.0000.00511.14
5.1.50.0050.00011.14
5.1.40.0030.00311.14
5.1.30.0050.00011.14
5.1.20.0000.00411.14
5.1.10.0000.00411.14
5.1.00.0000.00511.14
5.0.50.0000.00411.14
5.0.40.0000.00411.14
5.0.30.0020.00211.14
5.0.20.0000.00511.14
5.0.10.0000.00511.14
5.0.00.0050.00011.14
4.4.90.0000.00311.14
4.4.80.0030.00011.14
4.4.70.0030.00011.14
4.4.60.0000.00211.14
4.4.50.0000.00211.14
4.4.40.0000.00211.14
4.4.30.0000.00211.14
4.4.20.0020.00011.14
4.4.10.0000.00311.14
4.4.00.0000.00311.14
4.3.110.0000.00211.14
4.3.100.0000.00311.14
4.3.90.0000.00311.14
4.3.80.0000.00211.14
4.3.70.0000.00211.14
4.3.60.0000.00211.14
4.3.50.0000.00211.14
4.3.40.0000.00311.14
4.3.30.0000.00211.14
4.3.20.0000.00211.14
4.3.10.0000.00311.14
4.3.00.0020.00011.14

preferences:
21.19 ms | 401 KiB | 5 Q