3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 1; // Your case function b() { $a = 4; return true; } // Passing by reference function c(&$d) { $d = 5; return true; } // Using return function d($d) { $d = 6; return $d; } b(); var_dump($a); c($a); var_dump($a); $a = d($a); var_dump($a);

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.4.120.0140.00624.34
8.4.110.0100.01018.86
8.4.100.0080.00419.00
8.4.90.0040.00620.73
8.4.80.0090.01118.61
8.4.70.0040.00418.95
8.4.60.0110.01118.70
8.4.50.0060.00318.48
8.4.40.0100.01019.34
8.4.30.0100.01017.46
8.4.20.0100.01017.52
8.4.10.0090.00017.51
8.3.250.0080.01218.91
8.3.240.0090.00717.12
8.3.230.0110.00617.16
8.3.220.0110.00719.11
8.3.210.0080.00416.64
8.3.200.0040.00416.50
8.3.190.0070.01316.36
8.3.180.0110.00717.21
8.3.170.0050.00218.86
8.3.160.0040.00419.98
8.3.150.0100.00716.48
8.3.140.0090.00618.86
8.3.130.0040.00416.71
8.3.120.0030.00619.00
8.3.110.0060.00620.94
8.3.100.0070.00424.06
8.3.90.0040.01426.77
8.3.80.0030.00618.43
8.3.70.0070.01416.50
8.3.60.0090.00618.21
8.3.50.0080.01017.39
8.3.40.0110.00418.73
8.3.30.0090.00618.55
8.3.20.0040.00419.07
8.3.10.0050.00523.70
8.3.00.0040.00423.65
8.2.290.0100.01020.55
8.2.280.0110.00918.39
8.2.270.0160.00316.97
8.2.260.0040.00416.50
8.2.250.0080.00816.75
8.2.240.0080.00017.15
8.2.230.0030.00622.58
8.2.220.0000.00837.54
8.2.210.0110.00726.77
8.2.200.0030.00618.16
8.2.190.0040.01116.58
8.2.180.0160.00318.29
8.2.170.0120.00622.96
8.2.160.0070.00719.08
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00021.18
8.2.110.0030.00721.18
8.2.100.0080.00317.84
8.2.90.0080.00017.85
8.2.80.0050.00317.97
8.2.70.0030.00717.80
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0040.00421.01
8.2.30.0000.00819.18
8.2.20.0000.00717.88
8.2.10.0080.00019.49
8.2.00.0000.00719.48
8.1.330.0130.00621.95
8.1.320.0130.00617.78
8.1.310.0040.00418.35
8.1.300.0050.00517.71
8.1.290.0090.00018.88
8.1.280.0110.00425.92
8.1.270.0040.00422.11
8.1.260.0080.00026.35
8.1.250.0080.01128.09
8.1.240.0030.00622.48
8.1.230.0080.00420.92
8.1.220.0000.00817.77
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0060.00317.10
8.1.180.0030.00618.10
8.1.170.0080.00018.76
8.1.160.0030.00718.88
8.1.150.0040.00418.83
8.1.140.0040.00417.75
8.1.130.0030.00319.01
8.1.120.0000.00717.39
8.1.110.0040.00417.41
8.1.100.0000.01017.42
8.1.90.0030.00517.42
8.1.80.0080.00017.37
8.1.70.0030.00617.45
8.1.60.0030.00617.64
8.1.50.0050.00217.50
8.1.40.0030.00717.55
8.1.30.0040.00417.61
8.1.20.0070.00017.55
8.1.10.0040.00417.51
8.1.00.0080.00017.45
8.0.300.0000.00821.51
8.0.290.0030.00616.63
8.0.280.0020.00518.45
8.0.270.0000.00717.21
8.0.260.0000.00617.11
8.0.250.0060.00316.93
8.0.240.0000.00716.80
8.0.230.0000.00716.84
8.0.220.0040.00416.87
8.0.210.0030.00516.87
8.0.200.0000.00616.89
8.0.190.0000.00716.91
8.0.180.0000.00916.84
8.0.170.0060.00316.87
8.0.160.0030.00516.93
8.0.150.0020.00516.79
8.0.140.0070.00016.68
8.0.130.0000.00613.21
8.0.120.0030.00516.79
8.0.110.0070.00016.85
8.0.100.0070.00016.68
8.0.90.0000.00716.85
8.0.80.0100.00916.82
8.0.70.0070.00016.79
8.0.60.0070.00016.95
8.0.50.0000.00816.85
8.0.30.0070.01117.05
8.0.20.0140.00817.40
8.0.10.0000.00716.92
8.0.00.0120.00516.54
7.4.330.0040.00015.55
7.4.320.0050.00216.43
7.4.300.0000.00616.46
7.4.290.0030.00316.63
7.4.280.0000.00716.50
7.4.270.0030.00316.41
7.4.260.0000.00716.51
7.4.250.0040.00416.52
7.4.240.0030.00316.63
7.4.230.0040.00416.40
7.4.220.0030.00516.67
7.4.210.0090.00716.59
7.4.200.0000.00816.35
7.4.160.0100.00716.46
7.4.140.0100.00617.86
7.4.130.0130.00916.49
7.4.120.0080.01016.48
7.4.110.0080.00816.49
7.4.100.0070.01016.43
7.4.90.0000.01716.75
7.4.80.0060.01019.39
7.4.70.0090.01316.46
7.4.60.0130.00316.46
7.4.50.0000.01616.52
7.4.40.0100.00716.67
7.4.00.0040.01114.95
7.3.330.0020.00213.07
7.3.320.0030.00313.19
7.3.310.0000.00816.11
7.3.300.0030.00316.24
7.3.290.0040.00416.19
7.3.280.0040.01116.25
7.3.260.0100.00716.37
7.3.240.0090.00916.32
7.3.230.0040.01316.23
7.3.210.0000.01716.61
7.3.200.0080.00816.47
7.3.190.0060.01216.63
7.3.180.0070.01016.23
7.3.170.0100.00616.19
7.3.160.0100.00716.43
7.2.330.0090.00916.50
7.2.320.0120.00616.47
7.2.310.0120.00616.66
7.2.300.0120.00416.37
7.2.290.0090.01016.38
7.2.80.0300.01014.65
7.2.70.0340.00314.73
7.2.60.0310.00714.72
7.2.50.0350.01014.86
7.2.40.0380.00314.63
7.2.30.0350.00314.73
7.2.20.0300.01114.80
7.2.10.0220.01314.51
7.2.00.1000.00314.88
7.1.200.0000.00715.62
7.1.190.0250.01113.88
7.1.180.0230.01013.55
7.1.170.0250.01313.79
7.1.160.0250.00913.66
7.1.150.0280.00713.96
7.1.140.0250.01113.89
7.1.130.0310.00613.79
7.1.120.0330.00613.60
7.1.110.0120.00613.86
7.1.100.0160.00713.85
7.1.90.0430.00613.64
7.1.80.0480.00313.94
7.1.70.0360.00713.59
7.1.60.0430.01631.71
7.1.50.0530.01031.84
7.1.40.0550.00931.64
7.1.30.0520.01131.86
7.1.20.0520.01031.89
7.1.10.0400.01313.73
7.1.00.0360.00713.65

preferences:
135.01 ms | 403 KiB | 5 Q