3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { static $results=array(); static function insert( $number ) { //Inserts a number into the array array_push( self::$results, $number ); return new static; } static function add( $number ) { //Adds to the last inserted number self::$results[] = array_pop(self::$results) + $number; return new static; } static function results() { //Display results foreach(self::$results as $k=>$v) { echo "{$k} : {$v}<BR>\n"; } } } T::insert(4)-> add(2)-> insert(12)-> insert(2)-> add(1)-> results();

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.40.0110.00418.57
8.3.30.0140.00020.18
8.3.20.0080.00020.38
8.3.10.0000.00822.04
8.3.00.0050.00322.44
8.2.170.0150.00022.96
8.2.160.0070.00722.25
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0000.00826.16
8.2.120.0070.00020.59
8.2.110.0090.00019.21
8.2.100.0120.00317.78
8.2.90.0040.00419.30
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0030.00518.34
8.2.30.0070.00019.50
8.2.20.0000.00717.80
8.2.10.0060.00317.91
8.2.00.0040.00417.64
8.1.270.0040.00423.99
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00322.50
8.1.230.0080.00320.91
8.1.220.0040.00418.77
8.1.210.0000.00819.05
8.1.200.0040.00417.36
8.1.190.0020.00517.53
8.1.180.0050.00318.10
8.1.170.0040.00418.59
8.1.160.0050.00218.92
8.1.150.0070.00018.70
8.1.140.0050.00317.49
8.1.130.0030.00617.77
8.1.120.0070.00017.50
8.1.110.0000.00717.50
8.1.100.0060.00317.50
8.1.90.0030.00517.38
8.1.80.0030.00517.52
8.1.70.0070.00017.49
8.1.60.0000.00917.54
8.1.50.0070.00017.45
8.1.40.0000.01217.43
8.1.30.0040.00417.64
8.1.20.0050.00317.56
8.1.10.0040.00417.60
8.1.00.0040.00417.39
8.0.300.0070.00019.94
8.0.290.0040.00417.16
8.0.280.0070.00018.46
8.0.270.0000.00717.20
8.0.260.0030.00616.78
8.0.250.0040.00417.02
8.0.240.0040.00616.96
8.0.230.0070.00017.02
8.0.220.0000.00716.93
8.0.210.0030.00316.95
8.0.200.0030.00316.88
8.0.190.0070.00017.02
8.0.180.0040.00416.90
8.0.170.0000.00716.84
8.0.160.0000.00816.80
8.0.150.0070.00016.77
8.0.140.0030.00616.86
8.0.130.0000.00613.30
8.0.120.0040.00416.86
8.0.110.0080.00016.88
8.0.100.0040.00416.73
8.0.90.0000.00716.79
8.0.80.0120.00416.83
8.0.70.0000.00716.91
8.0.60.0000.00716.96
8.0.50.0070.00016.91
8.0.30.0060.01217.16
8.0.20.0140.00717.40
8.0.10.0060.00317.08
8.0.00.0060.01316.76
7.4.330.0020.00216.84
7.4.320.0060.00016.55
7.4.300.0060.00016.67
7.4.290.0070.00016.46
7.4.280.0040.00416.55
7.4.270.0030.00316.63
7.4.260.0000.00513.30
7.4.250.0040.00416.57
7.4.240.0020.00516.58
7.4.230.0000.00716.52
7.4.220.0120.01216.73
7.4.210.0070.00816.58
7.4.200.0040.00416.46
7.4.190.0040.00416.76
7.4.160.0060.01016.60
7.4.150.0100.01017.40
7.4.140.0100.01117.86
7.4.130.0080.00916.56
7.4.120.0070.01016.62
7.4.110.0130.00316.49
7.4.100.0110.00816.38
7.4.90.0060.01216.59
7.4.80.0070.01019.39
7.4.70.0100.00616.67
7.4.60.0090.00816.40
7.4.50.0060.00316.55
7.4.40.0100.00722.77
7.4.30.0140.00316.57
7.4.00.0000.01415.05
7.3.330.0000.00513.24
7.3.320.0030.00313.30
7.3.310.0030.00316.20
7.3.300.0030.00316.45
7.3.290.0030.01016.39
7.3.280.0090.00616.34
7.3.270.0080.00817.40
7.3.260.0070.01718.24
7.3.250.0110.00816.60
7.3.240.0060.01016.39
7.3.230.0030.01316.39
7.3.210.0140.00316.56
7.3.200.0160.00619.39
7.3.190.0100.00716.49
7.3.180.0060.00916.55
7.3.170.0130.00316.28
7.3.160.0100.00616.31
7.3.120.0090.00614.86
7.3.10.0040.01116.57
7.3.00.0060.00916.63
7.2.330.0110.00716.80
7.2.320.0030.01316.81
7.2.310.0150.00316.86
7.2.300.0100.00616.75
7.2.290.0070.01016.89
7.2.130.0110.00316.82
7.2.120.0040.01116.78
7.2.110.0040.01216.52
7.2.100.0030.01316.64
7.2.90.0120.00416.81
7.2.80.0110.00416.83
7.2.70.0090.00616.61
7.2.60.0090.00617.05
7.2.50.0070.00717.08
7.2.40.0040.00816.96
7.2.30.0180.00017.20
7.2.20.0070.00416.82
7.2.10.0040.00816.93
7.2.00.0030.01218.23
7.1.250.0040.00815.87
7.1.200.0040.00815.90
7.1.100.0040.00417.81
7.1.70.0000.01016.99
7.1.60.0000.02519.17
7.1.50.0110.00717.01
7.1.00.0030.03322.40
7.0.200.0000.00716.55
7.0.140.0070.06722.22
7.0.100.0200.07320.02
7.0.90.0270.07019.91
7.0.80.0100.04019.94
7.0.70.0100.04720.03
7.0.60.0130.04019.82
7.0.50.0100.08320.25
7.0.40.0000.05020.07
7.0.30.0100.08320.04
7.0.20.0130.05720.00
7.0.10.0130.04020.10
7.0.00.0100.04020.17
5.6.280.0000.07321.07
5.6.250.0030.08720.53
5.6.240.0130.03320.61
5.6.230.0170.03320.76
5.6.220.0070.04020.49
5.6.210.0030.04320.59
5.6.200.0070.03721.07
5.6.190.0000.04721.07
5.6.180.0130.08021.09
5.6.170.0030.06021.15
5.6.160.0070.04021.08
5.6.150.0030.04321.09
5.6.140.0100.06321.09
5.6.130.0130.04321.05
5.6.120.0070.04021.04
5.6.110.0030.05321.02
5.6.100.0030.04321.06
5.6.90.0070.04021.00
5.6.80.0030.06720.45
5.6.70.0030.04020.35
5.6.60.0100.07020.51
5.6.50.0000.05320.43
5.6.40.0070.03720.39
5.6.30.0100.06320.47
5.6.20.0030.04020.38
5.6.10.0000.04720.40
5.6.00.0100.08720.30
5.5.380.0100.06720.53
5.5.370.0000.04720.36
5.5.360.0030.04320.45
5.5.350.0070.04020.33
5.5.340.0030.06720.65
5.5.330.0000.04020.65
5.5.320.0130.08020.87
5.5.310.0030.06320.87
5.5.300.0000.04720.73
5.5.290.0000.07320.84
5.5.280.0070.04720.76
5.5.270.0000.05020.77
5.5.260.0030.05020.77
5.5.250.0070.04020.67
5.5.240.0070.04020.27
5.5.230.0000.07320.27
5.5.220.0170.02020.29
5.5.210.0000.04320.02
5.5.200.0030.04020.13
5.5.190.0100.06320.29
5.5.180.0070.07720.19
5.5.160.0030.07720.23
5.5.150.0100.07720.25
5.5.140.0170.06720.28
5.5.130.0130.07020.18
5.5.120.0070.07720.15
5.5.110.0000.08020.23
5.5.100.0170.07320.09
5.5.90.0200.05720.11
5.5.80.0030.08020.17
5.5.70.0170.06720.01
5.5.60.0070.08020.14
5.5.50.0130.06720.05
5.5.40.0170.07020.06
5.5.30.0130.07320.10
5.5.20.0200.06320.05
5.5.10.0070.08019.98
5.5.00.0030.08320.05
5.4.450.0070.05019.27
5.4.440.0030.04319.30
5.4.430.0000.05019.17
5.4.420.0100.03719.22
5.4.410.0030.05319.32
5.4.400.0030.03719.04
5.4.390.0030.04019.14
5.4.380.0070.03718.85
5.4.370.0100.03719.18
5.4.360.0100.03319.04
5.4.350.0030.03318.88
5.4.340.0000.05318.91
5.4.320.0030.08319.04
5.4.310.0200.06319.13
5.4.300.0000.08319.21
5.4.290.0130.06719.09
5.4.280.0030.08319.21
5.4.270.0070.07018.90
5.4.260.0070.07718.89
5.4.250.0100.07019.23
5.4.240.0130.07018.95
5.4.230.0130.06719.20
5.4.220.0070.07719.09
5.4.210.0170.07019.13
5.4.200.0130.06719.12
5.4.190.0100.07319.11
5.4.180.0100.06719.20
5.4.170.0030.07718.89
5.4.160.0130.07018.93
5.4.150.0100.07719.22
5.4.140.0100.07316.35
5.4.130.0070.06716.29
5.4.120.0100.06716.29
5.4.110.0130.06716.34
5.4.100.0030.05316.49
5.4.90.0070.07016.45
5.4.80.0070.06316.31
5.4.70.0030.07316.48
5.4.60.0130.07016.45
5.4.50.0000.07716.47
5.4.40.0030.07016.37
5.4.30.0070.07016.36
5.4.20.0030.05016.27
5.4.10.0130.06316.48
5.4.00.0000.05715.59
5.3.290.0030.07714.73
5.3.280.0100.06014.66
5.3.270.0070.07314.57
5.3.260.0130.06714.73
5.3.250.0100.06714.75
5.3.240.0200.06314.75
5.3.230.0100.07014.59
5.3.220.0100.06714.69
5.3.210.0130.06714.56
5.3.200.0030.08014.63
5.3.190.0130.06014.55
5.3.180.0070.05714.56
5.3.170.0070.05714.64
5.3.160.0000.06014.71
5.3.150.0030.07714.70
5.3.140.0130.07014.54
5.3.130.0100.05314.56
5.3.120.0030.08314.51
5.3.110.0030.07714.54
5.3.100.0130.07314.03
5.3.90.0070.06014.08
5.3.80.0030.07014.09
5.3.70.0100.06013.96
5.3.60.0070.04014.00
5.3.50.0100.07014.01
5.3.40.0130.04013.96
5.3.30.0100.07014.06
5.3.20.0070.07313.59
5.3.10.0130.05013.70
5.3.00.0170.06713.65
5.2.170.0100.05711.04
5.2.160.0100.06011.04
5.2.150.0100.05711.18
5.2.140.0030.06311.21
5.2.130.0070.06011.11
5.2.120.0070.05310.96
5.2.110.0070.06011.02
5.2.100.0070.05711.01
5.2.90.0100.05711.16
5.2.80.0130.05710.98
5.2.70.0000.06311.14
5.2.60.0170.05310.97
5.2.50.0100.05011.07
5.2.40.0030.06311.13
5.2.30.0070.06010.83
5.2.20.0070.05711.08
5.2.10.0030.05310.93
5.2.00.0030.06310.77
5.1.60.0070.05010.06
5.1.50.0070.05710.08
5.1.40.0030.0579.83
5.1.30.0030.05310.33
5.1.20.0100.04710.22
5.1.10.0070.0539.95
5.1.00.0000.04710.07
5.0.50.0070.0479.78
5.0.40.0030.0479.78
5.0.30.0030.0639.78
5.0.20.0130.0339.78
5.0.10.0100.0409.78
5.0.00.0000.0609.78
4.4.90.0000.0339.78
4.4.80.0070.0309.78
4.4.70.0070.0339.78
4.4.60.0070.0339.78
4.4.50.0000.0379.78
4.4.40.0030.0479.78
4.4.30.0000.0309.78
4.4.20.0000.0379.78
4.4.10.0030.0339.78
4.4.00.0000.0479.78
4.3.110.0000.0379.78
4.3.100.0000.0309.78
4.3.90.0070.0339.78
4.3.80.0000.0509.78
4.3.70.0000.0309.78
4.3.60.0030.0339.78
4.3.50.0000.0339.78
4.3.40.0100.0479.78
4.3.30.0030.0279.78
4.3.20.0000.0409.78
4.3.10.0030.0309.78
4.3.00.0000.0339.78

preferences:
43.84 ms | 400 KiB | 5 Q