3v4l.org

run code in 300+ PHP versions simultaneously
<?php /// Example 1 $str = "Simple text"; $a = function() { global $str; $str = "edited"; }; $a(); echo $str."\n"; /// edited /// Example 2 $str = "Simple text"; $a = function() { $GLOBALS["str"] = "edited"; }; $a(); echo $str."\n"; /// edited /// Example 3 $str = "Simple text"; $temp = ""; $a = function() { $GLOBALS["temp"] = &$GLOBALS["str"]; }; $a(); echo "[".$str."] [".$temp."]\n"; /// [Simple text] [Simple text] /// Example 4 $str = "Simple text"; $temp = ""; $a = function() { global $str, $temp; $temp = &$str; }; $a(); echo "[".$str."] [".$temp."]\n"; /// [Simple text] []

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.0090.00616.75
8.3.50.0100.00622.03
8.3.40.0070.00718.89
8.3.30.0090.00918.67
8.3.20.0080.00020.29
8.3.10.0080.00023.64
8.3.00.0040.00422.40
8.2.180.0090.00616.63
8.2.170.0070.00722.96
8.2.160.0140.00019.15
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00022.08
8.2.120.0040.00426.35
8.2.110.0030.00622.07
8.2.100.0000.01217.91
8.2.90.0040.00419.23
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0080.00018.00
8.2.50.0040.00418.10
8.2.40.0000.00720.38
8.2.30.0000.00719.39
8.2.20.0040.00417.77
8.2.10.0000.00718.14
8.2.00.0040.00417.82
8.1.280.0070.00725.92
8.1.270.0110.00323.74
8.1.260.0080.00028.09
8.1.250.0070.00028.09
8.1.240.0090.00020.92
8.1.230.0080.00319.13
8.1.220.0080.00017.79
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0040.00417.41
8.1.180.0030.00518.10
8.1.170.0080.00018.65
8.1.160.0000.00722.08
8.1.150.0030.00718.91
8.1.140.0030.00519.56
8.1.130.0000.00717.63
8.1.120.0030.00317.50
8.1.110.0040.00417.52
8.1.100.0000.00717.41
8.1.90.0070.00017.48
8.1.80.0000.00717.49
8.1.70.0080.00017.36
8.1.60.0050.00317.59
8.1.50.0000.00817.54
8.1.40.0040.00417.49
8.1.30.0040.00417.71
8.1.20.0000.00717.62
8.1.10.0040.00417.59
8.1.00.0000.00817.50
8.0.300.0000.00719.94
8.0.290.0040.00416.75
8.0.280.0000.00718.47
8.0.270.0000.00717.27
8.0.260.0030.00317.40
8.0.250.0060.00016.87
8.0.240.0000.00616.98
8.0.230.0030.00616.96
8.0.220.0000.00716.88
8.0.210.0000.00716.79
8.0.200.0000.00917.01
8.0.190.0080.00016.87
8.0.180.0080.00016.96
8.0.170.0070.00016.80
8.0.160.0030.00316.93
8.0.150.0000.00716.91
8.0.140.0000.00716.93
8.0.130.0000.00513.27
8.0.120.0000.00816.76
8.0.110.0040.00416.92
8.0.100.0080.00016.75
8.0.90.0040.00416.81
8.0.80.0040.01216.80
8.0.70.0040.00416.79
8.0.60.0050.00316.91
8.0.50.0000.00716.81
8.0.30.0100.00717.02
8.0.20.0080.01017.40
8.0.10.0040.00417.09
8.0.00.0130.00716.79
7.4.330.0020.00215.10
7.4.320.0000.00616.48
7.4.300.0000.00616.53
7.4.290.0070.00016.42
7.4.280.0050.00316.59
7.4.270.0000.00816.52
7.4.260.0060.00316.52
7.4.250.0000.00716.58
7.4.240.0000.00816.73
7.4.230.0030.00316.60
7.4.220.0220.00816.64
7.4.210.0040.01216.55
7.4.200.0040.00416.61
7.4.160.0090.00916.49
7.4.150.0110.00717.40
7.4.140.0100.01117.86
7.4.130.0120.01616.49
7.4.120.0080.01016.48
7.4.110.0090.00816.47
7.4.100.0120.00616.57
7.4.90.0140.00316.48
7.4.80.0030.01719.39
7.4.70.0100.00616.29
7.4.60.0170.00016.45
7.4.50.0000.01416.68
7.4.40.0130.00516.61
7.4.30.0150.00316.39
7.4.00.0030.01414.78
7.3.330.0000.00613.33
7.3.320.0030.00313.23
7.3.310.0000.00716.48
7.3.300.0030.00316.23
7.3.290.0090.00516.37
7.3.280.0070.01216.38
7.3.270.0030.01317.40
7.3.260.0100.00716.46
7.3.250.0130.00816.49
7.3.240.0140.00816.60
7.3.230.0090.00916.45
7.3.210.0100.00716.58
7.3.200.0000.01716.59
7.3.190.0100.00716.64
7.3.180.0060.01016.46
7.3.170.0090.00916.52
7.3.160.0110.00816.39
7.3.120.0050.01315.13
7.3.110.0150.00314.68
7.3.100.0090.00614.93
7.3.90.0040.01214.84
7.3.80.0110.00414.60
7.3.70.0030.01014.91
7.3.60.0000.01015.03
7.3.50.0060.00314.71
7.3.40.0060.01014.88
7.3.30.0000.00814.56
7.3.20.0070.00616.64
7.3.10.0090.00316.73
7.3.00.0080.00416.59
7.2.330.0090.00616.63
7.2.320.0130.00716.53
7.2.310.0070.01116.82
7.2.300.0080.01316.32
7.2.290.0170.00616.66
7.2.250.0060.01315.10
7.2.240.0070.01314.98
7.2.230.0060.00615.05
7.2.220.0060.00315.24
7.2.210.0000.01014.98
7.2.200.0070.01014.78
7.2.190.0070.00415.00
7.2.180.0000.01015.04
7.2.170.0030.00715.10
7.2.60.0100.00317.09
7.2.00.0040.00819.41
7.1.330.0110.00415.94
7.1.320.0000.01215.80
7.1.310.0060.00815.99
7.1.300.0030.01015.86
7.1.290.0060.00615.95
7.1.280.0090.00615.54
7.1.270.0030.00815.82
7.1.260.0070.00615.87
7.1.200.0120.00315.91
7.1.70.0070.00017.10
7.1.60.0030.01016.93
7.1.00.0030.07722.57
7.0.200.0080.00414.55
7.0.100.2030.05720.04
7.0.90.0130.05719.95
7.0.80.0070.05720.06
7.0.70.0070.05720.04
7.0.60.0030.06020.14
7.0.50.0100.05720.41
7.0.40.0100.05720.46
7.0.30.0170.05720.34
7.0.20.0170.05720.36
7.0.10.0230.04720.33
7.0.00.2100.05320.27
5.6.250.0130.05320.86
5.6.240.0070.06020.73
5.6.230.0030.06320.73
5.6.220.0070.05720.81
5.6.210.0170.04720.57
5.6.200.0030.06321.16
5.6.190.0070.05721.05
5.6.180.0100.06321.09
5.6.170.0070.06021.18
5.6.160.0070.05721.12
5.6.150.0070.05721.12
5.6.140.0070.05321.05
5.6.130.0130.05321.01
5.6.120.0070.06021.11
5.6.110.0170.05321.20
5.6.100.0200.05021.11
5.6.90.0070.06321.09
5.6.80.0170.04720.50
5.6.70.0100.05020.41
5.6.60.0030.06020.46
5.6.50.0170.04320.45
5.6.40.0130.04720.43
5.6.30.0130.04720.49
5.6.20.0000.06020.44
5.6.10.0070.05320.47
5.6.00.0130.04720.42

preferences:
58.58 ms | 401 KiB | 5 Q