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.PHP_EOL; echo my_vars::$var2.PHP_EOL; 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.70.0090.00916.58
8.3.60.0060.00916.63
8.3.50.0150.00723.00
8.3.40.0150.00318.67
8.3.30.0070.00719.10
8.3.20.0040.00420.24
8.3.10.0000.00823.65
8.3.00.0050.00319.38
8.2.180.0160.00616.50
8.2.170.0100.00722.96
8.2.160.0030.01220.51
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0070.00020.89
8.2.110.0030.00622.13
8.2.100.0090.00317.75
8.2.90.0040.00419.17
8.2.80.0080.00017.97
8.2.70.0000.00817.63
8.2.60.0080.00317.68
8.2.50.0040.00418.07
8.2.40.0050.00318.22
8.2.30.0040.00418.13
8.2.20.0000.00717.58
8.2.10.0050.00217.89
8.2.00.0080.00017.50
8.1.280.0030.01225.92
8.1.270.0000.00823.76
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00023.92
8.1.230.0000.01119.22
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0000.01017.34
8.1.190.0060.00317.22
8.1.180.0050.00318.10
8.1.170.0000.00818.59
8.1.160.0000.00721.90
8.1.150.0000.00718.91
8.1.140.0040.00417.46
8.1.130.0030.00317.84
8.1.120.0030.00317.51
8.1.110.0040.00417.45
8.1.100.0040.00417.38
8.1.90.0000.00717.46
8.1.80.0040.00317.34
8.1.70.0000.00717.38
8.1.60.0030.00517.63
8.1.50.0050.00317.46
8.1.40.0080.00017.55
8.1.30.0030.00517.63
8.1.20.0000.00717.69
8.1.10.0060.00317.61
8.1.00.0060.00517.49
8.0.300.0000.00718.77
8.0.290.0040.00816.63
8.0.280.0030.00418.37
8.0.270.0040.00417.28
8.0.260.0000.00717.28
8.0.250.0000.00616.95
8.0.240.0030.00316.80
8.0.230.0070.00016.91
8.0.220.0040.00316.93
8.0.210.0000.00716.87
8.0.200.0070.00016.86
8.0.190.0040.00316.96
8.0.180.0000.00816.86
8.0.170.0040.00416.89
8.0.160.0000.00716.96
8.0.150.0060.00316.86
8.0.140.0000.00816.79
8.0.130.0030.00313.38
8.0.120.0060.00316.88
8.0.110.0080.00016.73
8.0.100.0040.00417.00
8.0.90.0070.00016.88
8.0.80.0100.00616.79
8.0.70.0020.00516.95
8.0.60.0000.00716.75
8.0.50.0030.00516.70
8.0.30.0120.01017.01
8.0.20.0120.00717.40
8.0.10.0040.00416.93
8.0.00.0130.00516.69
7.4.330.0020.00215.09
7.4.320.0030.00316.45
7.4.300.0030.00316.59
7.4.290.0070.00016.48
7.4.280.0040.00416.53
7.4.270.0000.00716.64
7.4.260.0030.00316.49
7.4.250.0080.00016.50
7.4.240.0000.00716.62
7.4.230.0020.00516.40
7.4.220.0140.00416.52
7.4.210.0130.00716.56
7.4.200.0000.00716.59
7.4.160.0040.01116.53
7.4.150.0090.01017.40
7.4.140.0080.01017.86
7.4.130.0130.00816.45
7.4.120.0080.01016.58
7.4.110.0170.00716.48
7.4.100.0100.00716.32
7.4.90.0070.01016.22
7.4.80.0060.01119.39
7.4.70.0160.00616.43
7.4.60.0030.01116.49
7.4.50.0030.00316.55
7.4.40.0120.00916.65
7.4.30.0030.01316.77
7.4.00.0060.00714.91
7.3.330.0000.00713.28
7.3.320.0030.00213.17
7.3.310.0030.00316.36
7.3.300.0030.00316.14
7.3.290.0140.00016.36
7.3.280.0090.00716.30
7.3.270.0030.01317.40
7.3.260.0100.00716.59
7.3.250.0070.01016.39
7.3.240.0120.00416.64
7.3.230.0080.00816.39
7.3.210.0150.00316.32
7.3.200.0140.00719.39
7.3.190.0070.01716.59
7.3.180.0090.00616.36
7.3.170.0060.00916.39
7.3.160.0150.00016.27
7.3.120.0080.00714.81
7.3.110.0110.00614.66
7.3.100.0070.00914.66
7.3.90.0100.00314.76
7.3.80.0090.00414.91
7.3.70.0060.00814.73
7.3.60.0040.00914.79
7.3.50.0060.00814.69
7.3.40.0070.00714.58
7.3.30.0030.00914.67
7.3.20.0050.00816.63
7.3.10.0090.00616.58
7.3.00.0070.00916.61
7.2.330.0120.00616.48
7.2.320.0140.00516.38
7.2.310.0110.00616.60
7.2.300.0120.00816.79
7.2.290.0180.00316.54
7.2.250.0070.01214.88
7.2.240.0100.00714.53
7.2.230.0050.01114.77
7.2.220.0030.01014.97
7.2.210.0120.00414.87
7.2.200.0080.00915.00
7.2.190.0030.01014.63
7.2.180.0060.01114.86
7.2.170.0070.01014.75
7.2.160.0030.01214.98
7.2.150.0070.00716.71
7.2.140.0060.00616.89
7.2.130.0070.01016.95
7.2.120.0050.00516.77
7.2.110.0060.01016.65
7.2.100.0100.00617.02
7.2.90.0120.00416.90
7.2.80.0030.01016.83
7.2.70.0090.00916.91
7.2.60.0030.01316.98
7.2.50.0070.00716.95
7.2.40.0070.00716.77
7.2.30.0090.00616.89
7.2.20.0070.01016.67
7.2.10.0060.00616.83
7.2.00.0070.00517.97
7.1.330.0070.01015.59
7.1.320.0130.00515.71
7.1.310.0050.00715.44
7.1.300.0120.00315.54
7.1.290.0090.00615.50
7.1.280.0080.00315.59
7.1.270.0150.00215.53
7.1.260.0080.00415.62
7.1.250.0060.00915.56
7.1.240.0030.00915.67
7.1.230.0040.01115.63
7.1.220.0050.00815.68
7.1.210.0000.01015.49
7.1.200.0110.00415.69
7.1.190.0040.01115.70
7.1.180.0040.01215.36
7.1.170.0100.00715.55
7.1.160.0060.00615.73
7.1.150.0070.01115.69
7.1.140.0070.01115.67
7.1.130.0100.00315.74
7.1.120.0070.00715.66
7.1.110.0070.01015.77
7.1.100.0070.00816.86
7.1.90.0060.00615.75
7.1.80.0060.00315.66
7.1.70.0040.00716.28
7.1.60.0080.00717.57
7.1.50.0050.01016.40
7.1.40.0110.00415.74
7.1.30.0100.00315.43
7.1.20.0060.00315.63
7.1.10.0030.00515.64
7.1.00.0100.03519.04
7.0.330.0080.00515.52
7.0.320.0060.01015.32
7.0.310.0000.01415.27
7.0.300.0070.00715.28
7.0.290.0090.00315.04
7.0.280.0060.01015.32
7.0.270.0030.01115.13
7.0.260.0110.00415.19
7.0.250.0090.00615.22
7.0.240.0070.00715.40
7.0.230.0060.00615.21
7.0.220.0030.01015.52
7.0.210.0050.00515.29
7.0.200.2060.00714.75
7.0.190.0070.00715.40
7.0.180.0070.00315.09
7.0.170.0000.00915.11
7.0.160.0000.01315.49
7.0.150.0100.00315.24
7.0.140.0100.03618.72
7.0.130.0040.00415.45
7.0.120.0030.00615.10
7.0.110.0120.00415.36
7.0.100.0110.00415.33
7.0.90.0060.00915.15
7.0.80.0080.00315.38
7.0.70.0100.00315.10
7.0.60.0070.04417.60
7.0.50.0070.02516.63
7.0.40.0120.04216.68
7.0.30.0190.03016.71
7.0.20.0180.04316.67
7.0.10.0150.04016.78
7.0.00.0050.02816.72
5.6.400.0030.01014.57
5.6.390.0030.00614.37
5.6.380.0060.01014.29
5.6.370.0030.00814.23
5.6.360.0040.01114.32
5.6.350.0130.00014.49
5.6.340.0060.01214.36
5.6.330.0030.01014.13
5.6.320.0030.01414.44
5.6.310.0000.01314.04
5.6.300.0070.00714.34
5.6.290.0070.00414.23
5.6.280.0040.03817.72
5.6.270.0040.01114.29
5.6.260.0030.01014.20
5.6.250.0060.01014.40
5.6.240.0030.01214.14
5.6.230.0030.00914.12
5.6.220.0040.01114.37
5.6.210.0090.02217.40
5.6.200.0100.04116.26
5.6.190.0080.04517.31
5.6.180.1770.02517.55
5.6.170.0130.03217.39
5.6.160.0100.03817.41
5.6.150.0050.02516.18
5.6.140.0030.04316.21
5.6.130.0080.04416.33
5.6.120.0050.02517.69
5.6.110.0090.04017.61
5.6.100.0080.04417.70
5.6.90.0030.03117.56
5.6.80.0070.02817.40
5.6.70.0170.03817.26
5.6.60.0060.00914.01
5.6.50.0070.00313.97
5.6.40.0040.00814.17
5.6.30.0060.00614.18
5.6.20.0030.01014.46
5.6.10.0030.00914.04
5.6.00.0070.00714.15
5.5.380.0040.00714.26
5.5.370.0070.00714.23
5.5.360.0040.01414.09
5.5.350.0200.03317.34
5.5.340.0050.04616.18
5.5.330.0070.04717.14
5.5.320.0280.03717.43
5.5.310.0180.03817.09
5.5.300.0050.02816.03
5.5.290.0030.03616.04
5.5.280.0020.02717.44
5.5.270.0030.03217.40
5.5.260.0100.04017.60
5.5.250.0070.04317.45
5.5.240.2110.01817.00
5.5.230.0030.01013.99
5.5.220.0070.01014.52
5.5.210.0070.01013.93
5.5.200.0070.00714.12
5.5.190.0120.00014.41
5.5.180.0030.00714.34
5.5.170.0070.00714.14
5.5.160.0030.00913.94
5.5.150.0050.00614.30
5.5.140.0030.00613.93
5.5.130.0030.01014.32
5.5.120.0030.01014.16
5.5.110.0000.01014.32
5.5.100.0030.00614.16
5.5.90.0000.01114.04
5.5.80.0000.00814.31
5.5.70.0040.01013.95
5.5.60.0040.01114.06
5.5.50.0040.00713.79
5.5.40.0110.00413.97
5.5.30.0000.00813.95
5.5.20.0060.00714.28
5.5.10.0150.00014.30
5.5.00.0060.01014.00
5.4.450.0530.04215.24
5.4.440.0350.03515.17
5.4.430.0300.03615.43
5.4.420.0330.03115.45
5.4.410.0030.03115.31
5.4.400.0350.02815.10
5.4.390.0250.03314.98
5.4.380.0030.03414.83
5.4.370.0090.02214.88
5.4.360.0120.02214.79
5.4.350.0120.04011.53
5.4.340.0080.02211.41
5.4.330.0060.00311.17
5.4.320.0050.01911.74
5.4.310.0080.02311.71
5.4.300.0040.02211.72
5.4.290.0080.02211.67
5.4.280.0060.02211.72
5.4.270.0060.02011.68
5.4.260.0080.02611.71
5.4.250.0050.02211.55
5.4.240.0030.02211.72
5.4.230.0040.02111.75
5.4.220.0040.02011.88
5.4.210.0070.01811.67
5.4.200.0030.02311.85
5.4.190.0040.02411.80
5.4.180.0040.02211.71
5.4.170.0060.02111.73
5.4.160.0090.01611.71
5.4.150.0060.01811.71
5.4.140.0060.01911.53
5.4.130.0080.01811.54
5.4.120.0050.02011.58
5.4.110.0020.02311.48
5.4.100.0040.02111.51
5.4.90.0040.02111.52
5.4.80.0040.02111.55
5.4.70.0070.01811.54
5.4.60.0030.02311.60
5.4.50.0040.02011.53
5.4.40.0050.02111.50
5.4.30.0080.01811.53
5.4.20.0040.02311.51
5.4.10.0020.02111.51
5.4.00.0050.02211.14
5.3.290.0080.04012.80
5.3.280.0070.03612.71
5.3.270.0060.04012.72
5.3.260.0070.03912.72
5.3.250.0090.03812.72
5.3.240.0080.03512.72
5.3.230.0050.03812.71
5.3.220.0050.03812.68
5.3.210.0080.03612.68
5.3.200.0070.03512.68
5.3.190.0020.04112.68
5.3.180.0060.03712.67
5.3.170.0090.03912.67
5.3.160.0050.04312.68
5.3.150.0050.04212.67
5.3.140.0070.04012.66
5.3.130.0040.03912.66
5.3.120.0110.03712.66
5.3.110.0080.03512.66
5.3.100.0020.04012.12
5.3.90.0070.04212.11
5.3.80.0040.03812.09
5.3.70.0050.03712.09
5.3.60.0100.03912.08
5.3.50.0050.03612.03
5.3.40.0070.04112.02
5.3.30.0020.03811.98
5.3.20.0050.03811.77
5.3.10.0090.03111.73
5.3.00.0040.03711.71
5.2.170.0050.0309.22
5.2.160.0020.0319.22
5.2.150.0030.0329.22
5.2.140.0040.0319.22
5.2.130.0040.0309.18
5.2.120.0030.0299.18
5.2.110.0050.0289.18
5.2.100.0070.0279.18
5.2.90.0040.0309.18
5.2.80.0060.0299.18
5.2.70.0070.0299.18
5.2.60.0070.0289.13
5.2.50.0070.0279.10
5.2.40.0030.0329.07
5.2.30.0030.0329.06
5.2.20.0050.0279.04
5.2.10.0040.0278.95
5.2.00.0060.0288.81
5.1.60.0030.0258.09
5.1.50.0030.0258.09
5.1.40.0050.0228.07
5.1.30.0030.0268.42
5.1.20.0040.0268.44
5.1.10.0020.0278.17
5.1.00.0010.0288.17
5.0.50.0050.0186.64
5.0.40.0020.0206.50
5.0.30.0030.0316.32
5.0.20.0040.0186.28
5.0.10.0040.0196.26
5.0.00.0020.0316.25
4.4.90.0030.0154.78
4.4.80.0030.0144.76
4.4.70.0010.0174.75
4.4.60.0020.0164.75
4.4.50.0020.0164.77
4.4.40.0020.0264.71
4.4.30.0010.0174.76
4.4.20.0010.0174.84
4.4.10.0030.0144.85
4.4.00.0030.0244.76
4.3.110.0030.0144.66
4.3.100.0020.0144.66
4.3.90.0040.0124.64
4.3.80.0030.0234.58
4.3.70.0020.0144.63
4.3.60.0020.0144.62
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0020.0163.30
4.3.20.0050.0123.28
4.3.10.0020.0153.24
4.3.00.0130.0237.01

preferences:
63.45 ms | 401 KiB | 5 Q