3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Some file #1 */ /** * Using a class to orginize your commonly accessed variables has a few * benifits, one of which is being able to well document each variable. */ class my_vars { /** * Does this, this, and this. Is set in /path/file.ext */ public static $var1; /** * Does this, this, and this. Is set by my_vars::init() */ public static $var2; /** * Does this, this, and this. */ public static $var3 = 'baz'; /*** Methods ***/ /** * Sets up some of the variables values. Should be called at the end of this * file, or sometime later in the script. */ public static function init() { self::$var2 = 'bar'; } } my_vars::init(); /* Some (later) file #2 */ function my_func() { // do stuff my_vars::$var1 = 'foo'; // do stuff } my_func(); echo my_vars::$var1."\n"; echo my_vars::$var2."\n"; echo my_vars::$var3; ?>

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.0100.00716.63
8.3.50.0120.00622.76
8.3.40.0070.01118.70
8.3.30.0040.01119.25
8.3.20.0000.00820.16
8.3.10.0080.00023.61
8.3.00.0050.00319.38
8.2.180.0090.00616.36
8.2.170.0070.00722.96
8.2.160.0070.00720.34
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00020.99
8.2.110.0030.00622.26
8.2.100.0060.00617.91
8.2.90.0050.00219.09
8.2.80.0050.00317.97
8.2.70.0080.00017.75
8.2.60.0040.00417.80
8.2.50.0050.00318.07
8.2.40.0080.00018.22
8.2.30.0040.00418.00
8.2.20.0060.00317.75
8.2.10.0020.00518.11
8.2.00.0050.00317.50
8.1.280.0140.00025.92
8.1.270.0150.00023.83
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0030.00623.92
8.1.230.0060.00619.15
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0100.00017.35
8.1.190.0090.00017.22
8.1.180.0000.00818.10
8.1.170.0000.00818.65
8.1.160.0040.00421.94
8.1.150.0040.00418.89
8.1.140.0050.00317.52
8.1.130.0000.00717.89
8.1.120.0000.00717.38
8.1.110.0040.00417.50
8.1.100.0050.00317.43
8.1.90.0000.00717.35
8.1.80.0030.00317.43
8.1.70.0030.00517.33
8.1.60.0030.00517.61
8.1.50.0030.00517.55
8.1.40.0030.00617.58
8.1.30.0040.00417.72
8.1.20.0040.00417.61
8.1.10.0000.00817.57
8.1.00.0040.00717.50
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0030.00318.39
8.0.270.0000.00716.89
8.0.260.0000.00617.19
8.0.250.0030.00317.02
8.0.240.0030.00317.01
8.0.230.0070.00016.83
8.0.220.0000.00716.91
8.0.210.0080.00016.90
8.0.200.0070.00016.86
8.0.190.0040.00416.93
8.0.180.0070.00016.97
8.0.170.0080.00016.89
8.0.160.0070.00016.84
8.0.150.0000.01016.90
8.0.140.0000.00716.77
8.0.130.0030.00313.32
8.0.120.0000.00716.87
8.0.110.0000.00816.95
8.0.100.0070.00016.89
8.0.90.0000.00816.84
8.0.80.0060.00916.86
8.0.70.0040.00416.82
8.0.60.0070.00016.79
8.0.50.0070.00016.91
8.0.30.0080.01317.42
8.0.20.0080.01317.40
8.0.10.0040.00416.98
8.0.00.0160.01116.89
7.4.330.0050.00015.09
7.4.320.0030.00316.53
7.4.300.0060.00016.62
7.4.290.0000.00716.59
7.4.280.0000.00816.54
7.4.270.0080.00016.55
7.4.260.0040.00416.60
7.4.250.0000.00816.59
7.4.240.0020.00616.53
7.4.230.0000.00716.59
7.4.220.0030.01516.57
7.4.210.0080.00516.66
7.4.200.0070.00016.59
7.4.160.0110.00716.47
7.4.150.0100.01017.40
7.4.140.0150.01317.86
7.4.130.0080.01016.55
7.4.120.0090.00816.54
7.4.110.0130.01016.48
7.4.100.0080.01116.56
7.4.90.0000.01616.55
7.4.80.0040.01419.39
7.4.70.0150.00316.43
7.4.60.0110.00616.76
7.4.50.0080.00016.32
7.4.40.0130.01016.43
7.4.30.0150.00316.59
7.4.00.0030.01015.13
7.3.330.0030.00313.29
7.3.320.0000.00613.38
7.3.310.0000.00716.34
7.3.300.0030.00316.14
7.3.290.0030.01016.28
7.3.280.0090.00616.29
7.3.270.0060.01217.40
7.3.260.0100.01116.32
7.3.250.0070.01016.56
7.3.240.0100.00716.30
7.3.230.0090.00816.55
7.3.210.0090.00616.53
7.3.200.0060.00919.39
7.3.190.0100.01316.61
7.3.180.0060.00916.49
7.3.170.0140.00316.48
7.3.160.0070.00716.38
7.2.330.0170.00016.63
7.2.320.0060.01616.68
7.2.310.0080.00916.75
7.2.300.0090.00616.64
7.2.290.0100.01016.41
7.2.60.0140.00616.14
7.2.00.0100.00619.51
7.1.200.0030.00715.42
7.1.100.0060.00617.71
7.1.70.0000.00817.07
7.1.60.0110.01419.40
7.1.50.0000.01816.94
7.1.00.0000.08022.26
7.0.200.0430.00714.67
7.0.140.0030.07322.01
7.0.60.0100.07721.63
7.0.50.0100.07017.84
7.0.40.0000.05020.21
7.0.30.0200.04720.07
7.0.20.0330.07020.19
7.0.10.0000.07320.19
7.0.00.0030.04020.07
5.6.280.0030.07021.02
5.6.210.0030.07320.48
5.6.200.0030.04718.24
5.6.190.0000.04720.59
5.6.180.0330.06020.78
5.6.170.0230.05320.54
5.6.160.0030.06020.55
5.6.150.0100.04018.28
5.6.140.0070.06018.19
5.6.130.0100.03318.23
5.6.120.0070.08321.10
5.6.110.0100.08020.98
5.6.100.0030.07720.98
5.6.90.0030.07721.13
5.6.80.0030.04020.41
5.5.350.0000.05020.47
5.5.340.0070.07718.02
5.5.330.0070.04720.27
5.5.320.0270.06020.30
5.5.310.0270.03020.18
5.5.300.0030.04318.00
5.5.290.0130.08017.95
5.5.280.0030.04020.81
5.5.270.0030.07020.77
5.5.260.0170.07720.80
5.5.250.0130.08020.58
5.5.240.0130.04320.22
5.4.450.0770.06019.34
5.4.440.0100.06319.43
5.4.430.0170.05319.64
5.4.420.0070.05719.21
5.4.410.0230.04019.19
5.4.400.0170.05019.11
5.4.390.0170.05319.18
5.4.380.0130.05018.70
5.4.370.0130.03318.80
5.4.360.0070.04018.50
5.4.350.0130.05412.02
5.4.340.0060.04712.02
5.4.320.0060.03712.51
5.4.310.0050.03912.50
5.4.300.0050.03812.51
5.4.290.0060.03812.51
5.4.280.0090.03112.40
5.4.270.0080.03312.40
5.4.260.0030.04012.40
5.4.250.0080.03512.40
5.4.240.0050.03612.40
5.4.230.0100.03412.39
5.4.220.0070.03512.39
5.4.210.0070.03312.40
5.4.200.0050.03712.40
5.4.190.0060.03512.39
5.4.180.0040.03712.39
5.4.170.0060.03512.39
5.4.160.0040.03712.39
5.4.150.0050.03612.39
5.4.140.0050.03712.07
5.4.130.0000.04012.06
5.4.120.0050.03512.02
5.4.110.0060.03512.02
5.4.100.0070.03312.01
5.4.90.0040.03812.02
5.4.80.0070.03512.02
5.4.70.0050.03512.01
5.4.60.0070.03312.02
5.4.50.0060.03412.01
5.4.40.0030.03712.00
5.4.30.0060.03512.00
5.4.20.0040.03612.00
5.4.10.0050.03412.00
5.4.00.0070.03411.48
5.3.290.0060.04012.80
5.3.280.0090.03412.71
5.3.270.0070.03712.72
5.3.260.0080.03612.72
5.3.250.0050.03812.72
5.3.240.0080.03512.72
5.3.230.0060.03812.71
5.3.220.0070.03512.68
5.3.210.0040.04012.68
5.3.200.0060.03612.68
5.3.190.0070.03612.68
5.3.180.0040.03712.68
5.3.170.0050.03712.67
5.3.160.0040.03712.68
5.3.150.0040.03812.67
5.3.140.0100.03212.66
5.3.130.0050.04012.66
5.3.120.0100.03512.66
5.3.110.0140.03112.66
5.3.100.0140.02912.12
5.3.90.0070.03512.11
5.3.80.0070.03812.09
5.3.70.0130.02912.09
5.3.60.0090.03312.08
5.3.50.0120.03112.03
5.3.40.0050.03712.02
5.3.30.0100.03011.99
5.3.20.0050.03611.77
5.3.10.0110.02911.73
5.3.00.0040.03711.72
5.2.170.0050.0299.22
5.2.160.0030.0309.21
5.2.150.0050.0309.22
5.2.140.0040.0319.21
5.2.130.0040.0299.18
5.2.120.0030.0319.18
5.2.110.0030.0319.19
5.2.100.0060.0329.18
5.2.90.0050.0299.18
5.2.80.0070.0289.18
5.2.70.0060.0299.18
5.2.60.0080.0279.13
5.2.50.0040.0339.10
5.2.40.0060.0279.07
5.2.30.0020.0319.05
5.2.20.0080.0259.04
5.2.10.0050.0328.95
5.2.00.0060.0288.82
5.1.60.0050.0228.09
5.1.50.0020.0268.09
5.1.40.0040.0248.07
5.1.30.0010.0298.42
5.1.20.0040.0268.44
5.1.10.0060.0248.17
5.1.00.0060.0258.17
5.0.50.0050.0196.64
5.0.40.0090.0196.50
5.0.30.0070.0386.31
5.0.20.0030.0256.29
5.0.10.0050.0256.26
5.0.00.0040.0426.25
4.4.90.0040.0184.77
4.4.80.0020.0174.75
4.4.70.0040.0154.75
4.4.60.0030.0174.75
4.4.50.0000.0254.77
4.4.40.0030.0354.71
4.4.30.0020.0234.76
4.4.20.0040.0224.84
4.4.10.0060.0204.85
4.4.00.0040.0314.76
4.3.110.0030.0194.67
4.3.100.0050.0164.66
4.3.90.0060.0164.64
4.3.80.0020.0274.58
4.3.70.0060.0194.63
4.3.60.0050.0154.63
4.3.50.0030.0174.63
4.3.40.0060.0274.54
4.3.30.0020.0173.30
4.3.20.0020.0193.28
4.3.10.0020.0183.23
4.3.00.0170.0177.13

preferences:
34.87 ms | 400 KiB | 5 Q