3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestCache { var $vars = array(); function assign ($var, $value) { $this->vars[$var] = $value; } function fetch ($var) { return $this->vars[$var]; } } $a = new stdClass; $a->x = 3; $cache = new TestCache(); $cache->assign('a', $a); $a->x = $a->x + 1; $cachedObject = $cache->fetch('a'); if ($cachedObject->x == $a->x) { print 'By reference'; } else { print 'By value'; }

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.0150.00318.26
8.3.50.0100.00821.14
8.3.40.0140.00018.67
8.3.30.0070.00720.30
8.3.20.0030.00620.30
8.3.10.0060.00321.23
8.3.00.0000.00922.43
8.2.180.0120.00616.50
8.2.170.0110.00422.96
8.2.160.0060.01322.12
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00420.75
8.2.110.0060.00319.30
8.2.100.0040.00717.91
8.2.90.0040.00419.16
8.2.80.0080.00017.97
8.2.70.0000.00817.50
8.2.60.0030.00618.03
8.2.50.0080.00318.07
8.2.40.0040.00418.21
8.2.30.0050.00319.31
8.2.20.0040.00417.64
8.2.10.0050.00317.73
8.2.00.0000.00717.55
8.1.280.0120.00625.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0040.00421.46
8.1.230.0070.00417.51
8.1.220.0070.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00617.35
8.1.190.0080.00417.22
8.1.180.0040.00418.10
8.1.170.0040.00418.57
8.1.160.0040.00418.80
8.1.150.0000.00818.55
8.1.140.0000.00717.39
8.1.130.0080.00017.82
8.1.120.0040.00417.50
8.1.110.0070.00017.47
8.1.100.0040.00417.46
8.1.90.0050.00317.30
8.1.80.0040.00417.29
8.1.70.0000.00717.34
8.1.60.0030.00717.51
8.1.50.0040.00417.39
8.1.40.0060.00317.47
8.1.30.0000.00717.58
8.1.20.0090.00017.57
8.1.10.0070.00017.58
8.1.00.0000.00717.47
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0070.00018.42
8.0.270.0040.00417.20
8.0.260.0000.00616.77
8.0.250.0000.00716.89
8.0.240.0030.00616.91
8.0.230.0050.00316.87
8.0.220.0000.00716.80
8.0.210.0070.00016.83
8.0.200.0030.00316.77
8.0.190.0040.00416.87
8.0.180.0000.01016.90
8.0.170.0070.00016.84
8.0.160.0080.00016.79
8.0.150.0000.00716.81
8.0.140.0040.00416.75
8.0.130.0030.00313.29
8.0.120.0050.00316.82
8.0.110.0000.00716.79
8.0.100.0000.00816.72
8.0.90.0070.00016.76
8.0.80.0110.00316.80
8.0.70.0020.00516.83
8.0.60.0000.00816.66
8.0.50.0050.00316.91
8.0.30.0060.01217.12
8.0.20.0100.00917.40
8.0.10.0020.00517.02
8.0.00.0140.01216.84
7.4.330.0000.00614.86
7.4.320.0040.00416.58
7.4.300.0000.00616.59
7.4.290.0070.00016.61
7.4.280.0000.00716.48
7.4.270.0000.00616.40
7.4.260.0000.00513.29
7.4.250.0000.00716.56
7.4.240.0030.00316.43
7.4.230.0050.00216.50
7.4.220.0110.00916.67
7.4.210.0070.00816.62
7.4.200.0040.00416.59
7.4.190.0000.00716.56
7.4.160.0060.00916.55
7.4.150.0030.01317.40
7.4.140.0120.00817.86
7.4.130.0120.00916.55
7.4.120.0090.01016.60
7.4.110.0070.01116.31
7.4.100.0000.01716.56
7.4.90.0070.01116.55
7.4.80.0090.00919.39
7.4.70.0060.00916.54
7.4.60.0100.00716.65
7.4.50.0030.00616.37
7.4.40.0130.00322.77
7.4.30.0130.00916.40
7.4.00.0000.01415.12
7.3.330.0020.00213.36
7.3.320.0060.00013.40
7.3.310.0040.00416.35
7.3.300.0050.00216.22
7.3.290.0070.00716.41
7.3.280.0100.00816.36
7.3.270.0180.00717.40
7.3.260.0130.00718.24
7.3.250.0090.01116.63
7.3.240.0110.00516.31
7.3.230.0030.01316.52
7.3.210.0080.00816.25
7.3.200.0090.01219.39
7.3.190.0030.01316.30
7.3.180.0100.00616.35
7.3.170.0030.01416.55
7.3.160.0070.01016.44
7.3.120.0060.01014.77
7.2.330.0080.00816.73
7.2.320.0060.01216.75
7.2.310.0060.01216.89
7.2.300.0100.00616.64
7.2.290.0080.00816.70
7.2.120.0080.00416.63
7.2.110.0030.00916.55
7.2.100.0060.00616.89
7.2.90.0030.01016.60
7.2.80.0060.00916.69
7.2.70.0110.00416.73
7.2.60.0050.00816.84
7.2.50.0090.00616.90
7.2.40.0000.01516.76
7.2.30.0060.00916.80
7.2.20.0030.01017.13
7.2.10.0090.00616.69
7.2.00.0060.00818.17
7.1.240.0090.00015.90
7.1.230.0060.00615.84
7.1.220.0100.00015.71
7.1.210.0060.00615.54
7.1.200.0060.00415.66
7.1.190.0100.00315.76
7.1.180.0030.00515.78
7.1.170.0030.00715.89
7.1.160.0040.00415.57
7.1.150.0100.00015.94
7.1.140.0080.00415.89
7.1.130.0070.00415.94
7.1.120.0040.00415.88
7.1.110.0000.01515.96
7.1.100.0030.00817.00
7.1.90.0070.00015.88
7.1.80.0120.00015.66
7.1.70.0060.00416.51
7.1.60.0080.01217.38
7.1.50.0100.00916.35
7.1.40.0060.00615.97
7.1.30.0060.00615.77
7.1.20.0060.00615.88
7.1.10.0070.00715.72
7.1.00.0050.01819.04
7.0.320.0060.00615.09
7.0.310.0040.01215.29
7.0.300.0080.00015.39
7.0.290.0030.01015.18
7.0.280.0060.00315.09
7.0.270.0040.00815.38
7.0.260.0040.00815.25
7.0.250.0060.00915.35
7.0.240.0070.00715.32
7.0.230.0030.00715.21
7.0.220.0100.00315.43
7.0.210.0030.01015.10
7.0.200.0080.00616.18
7.0.190.0060.00315.53
7.0.180.0090.00615.42
7.0.170.0000.00915.18
7.0.160.0070.00715.48
7.0.150.0080.00415.49
7.0.140.0080.03618.57
7.0.130.0000.01215.53
7.0.120.0060.00615.41
7.0.110.0090.00315.17
7.0.100.0100.03317.73
7.0.90.0080.04117.67
7.0.80.0070.03317.61
7.0.70.0020.05117.70
7.0.60.0100.03717.64
7.0.50.0250.04717.97
7.0.40.0000.03816.72
7.0.30.0080.04116.70
7.0.20.0050.04716.69
7.0.10.0060.03716.88
7.0.00.0080.04316.72
5.6.380.0000.01114.41
5.6.370.0030.01014.43
5.6.360.0150.00014.36
5.6.350.0110.00414.43
5.6.340.0100.00314.70
5.6.330.0040.00814.28
5.6.320.0030.00514.48
5.6.310.0030.01014.69
5.6.300.0080.00614.49
5.6.290.0060.00914.43
5.6.280.0070.03517.81
5.6.270.0000.01014.45
5.6.260.0000.01314.40
5.6.250.0120.03817.65
5.6.240.0040.04917.54
5.6.230.0080.04617.52
5.6.220.0100.04317.58
5.6.210.0100.03917.53
5.6.200.0140.04017.71
5.6.190.0100.04517.66
5.6.180.0050.04217.77
5.6.170.0130.04217.66
5.6.160.0100.04017.66
5.6.150.0090.04117.76
5.6.140.0150.03517.67
5.6.130.0050.04617.82
5.6.120.0100.04317.90
5.6.110.0050.04417.68
5.6.100.0080.04517.57
5.6.90.0130.03817.56
5.6.80.0070.04317.44
5.6.70.0100.03917.49
5.6.60.0100.03817.47
5.6.50.0070.03517.42
5.6.40.0130.03717.53
5.6.30.0030.02617.43
5.6.20.0080.04017.50
5.6.10.0030.04817.32
5.6.00.0050.04317.42
5.5.380.0120.04115.86
5.5.370.0050.04316.02
5.5.360.0090.04015.93
5.5.350.0110.03815.75
5.5.340.0130.04116.12
5.5.330.0020.04716.13
5.5.320.0020.04616.23
5.5.310.0050.04116.14
5.5.300.0050.04216.19
5.5.290.0030.04716.13
5.5.280.0090.03816.01
5.5.270.0020.03616.07
5.5.260.0090.04515.94
5.5.250.0100.03615.99
5.5.240.0070.03515.80
5.5.230.0020.03315.63
5.5.220.0080.03515.77
5.5.210.0070.04415.72
5.5.200.0060.04115.76
5.5.190.0050.02215.77
5.5.180.0090.04015.83
5.5.170.0050.00514.31
5.5.160.0050.03015.73
5.5.150.0020.03415.86
5.5.140.0100.03315.81
5.5.130.0120.03715.85
5.5.120.0020.02815.82
5.5.110.0120.03415.77
5.5.100.0050.03815.78
5.5.90.0030.03815.60
5.5.80.0070.04015.59
5.5.70.0050.04415.74
5.5.60.0030.04215.69
5.5.50.0100.04215.77
5.5.40.0090.03315.60
5.5.30.0040.03415.68
5.5.20.0040.04015.75
5.5.10.0120.03815.71
5.5.00.0090.04015.60
5.4.450.0080.03615.17
5.4.440.0070.04215.25
5.4.430.0030.04515.17
5.4.420.0050.04515.38
5.4.410.0010.04815.43
5.4.400.0080.02215.10
5.4.390.0090.03815.12
5.4.380.0030.02315.14
5.4.370.0080.03115.26
5.4.360.0050.04115.18
5.4.350.0030.04415.24
5.4.340.0080.02315.04
5.4.330.0030.00711.23
5.4.320.0070.02915.23
5.4.310.0170.01515.23
5.4.300.0080.03815.16
5.4.290.0070.04015.13
5.4.280.0070.02815.14
5.4.270.0090.02715.12
5.4.260.0070.03915.13
5.4.250.0050.02615.00
5.4.240.0070.03215.14
5.4.230.0110.03415.10
5.4.220.0090.03914.95
5.4.210.0030.04215.14
5.4.200.0100.03515.12
5.4.190.0020.04115.07
5.4.180.0090.03715.06
5.4.170.0070.03615.01
5.4.160.0090.03014.99
5.4.150.0080.04015.22
5.4.140.0070.03813.87
5.4.130.0070.03913.86
5.4.120.0110.03413.71
5.4.110.0090.03913.79
5.4.100.0040.04013.90
5.4.90.0090.02913.76
5.4.80.0100.03313.81
5.4.70.0020.03513.67
5.4.60.0070.02213.85
5.4.50.0030.02313.81
5.4.40.0080.02113.76
5.4.30.0030.02313.85
5.4.20.0050.02213.86
5.4.10.0090.02713.82
5.4.00.0050.02013.45
5.3.290.0050.03712.71
5.3.280.0040.04212.55
5.3.270.0080.04012.63
5.3.260.0120.03512.70
5.3.250.0040.02212.69
5.3.240.0080.03812.61
5.3.230.0060.04212.68
5.3.220.0120.03512.61
5.3.210.0100.03712.55
5.3.200.0110.03512.60
5.3.190.0040.04312.47
5.3.180.0070.03612.54
5.3.170.0030.04312.60
5.3.160.0050.02412.74
5.3.150.0050.02412.74
5.3.140.0100.01612.63
5.3.130.0020.02212.69
5.3.120.0030.02112.58
5.3.110.0070.01812.63
5.3.100.0040.02012.42
5.3.90.0000.02612.37
5.3.80.0030.02312.17
5.3.70.0040.02112.23
5.3.60.0060.01912.27
5.3.50.0030.02912.34
5.3.40.0040.02112.23
5.3.30.0050.01812.21
5.3.20.0020.02212.14
5.3.10.0050.02011.97
5.3.00.0030.02112.05
5.2.170.0020.02210.72
5.2.160.0030.01810.79
5.2.150.0020.01910.78
5.2.140.0070.01310.79
5.2.130.0050.03010.74
5.2.120.0030.01710.74
5.2.110.0030.02110.72
5.2.100.0020.01910.72
5.2.90.0050.02210.72
5.2.80.0020.01710.72
5.2.70.0060.02310.72
5.2.60.0010.02010.72
5.2.50.0000.02210.72
5.2.40.0030.01810.72
5.2.30.0050.03010.72
5.2.20.0020.02410.72
5.2.10.0010.01810.72
5.2.00.0050.01310.72
5.1.60.0060.01510.72
5.1.50.0030.01510.72
5.1.40.0050.01710.72
5.1.30.0030.01610.72
5.1.20.0000.01610.72
5.1.10.0040.01710.72
5.1.00.0060.01610.72
5.0.50.0020.01210.72
5.0.40.0020.01210.72
5.0.30.0030.01810.72
5.0.20.0020.01710.72
5.0.10.0020.01310.72
5.0.00.0030.01510.72
4.4.90.0010.01010.72
4.4.80.0000.01410.72
4.4.70.0040.00810.72
4.4.60.0050.00610.72
4.4.50.0040.00910.72
4.4.40.0030.01210.72
4.4.30.0000.01210.72
4.4.20.0030.01010.72
4.4.10.0020.01010.72
4.4.00.0020.01610.72
4.3.110.0000.01210.72
4.3.100.0030.01810.72
4.3.90.0030.00810.72
4.3.80.0040.01410.72
4.3.70.0020.00910.72
4.3.60.0030.01410.72
4.3.50.0020.01510.72
4.3.40.0050.01110.72
4.3.30.0030.00810.72
4.3.20.0020.01810.72
4.3.10.0030.00710.72
4.3.00.0010.01010.72

preferences:
58.74 ms | 400 KiB | 5 Q