3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getVar(&$var) { $tmp = $var; // store the variable value $var = '_$_%&33xc$%^*7_r4'; // give the variable a new unique value $name = array_search($var, $GLOBALS); // search $GLOBALS for that unique value and return the key(variable) $var = $tmp; // restore the variable old value return $name; } $city = "San Francisco"; $age = 55; $object = new Stdclass; $arr = array(3, 5, 6); echo getVar($city). PHP_EOL; echo getVar($age). PHP_EOL; echo getVar($object). PHP_EOL; echo getVar($arr). PHP_EOL;

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.0110.01116.63
8.3.50.0040.01218.25
8.3.40.0120.00918.79
8.3.30.0040.01219.24
8.3.20.0160.00323.89
8.3.10.0100.00424.08
8.3.00.0080.00623.44
8.2.180.0070.01425.92
8.2.170.0120.00922.96
8.2.160.0040.01122.96
8.2.150.0070.00723.27
8.2.140.0030.01023.37
8.2.130.0070.00724.22
8.2.120.0090.00620.26
8.2.110.0080.00721.05
8.2.100.0050.00919.33
8.2.90.0060.00919.85
8.2.80.0070.00719.38
8.2.70.0070.00618.97
8.2.60.0100.00518.94
8.2.50.0020.00919.13
8.2.40.0070.00719.35
8.2.30.0110.00519.12
8.2.20.0080.00319.19
8.2.10.0090.00219.87
8.2.00.0060.00819.69
8.1.280.0120.00325.92
8.1.270.0060.00623.84
8.1.260.0090.00225.13
8.1.250.0090.00226.03
8.1.240.0080.00522.03
8.1.230.0070.00620.02
8.1.220.0110.00419.51
8.1.210.0050.00919.55
8.1.200.0120.00118.90
8.1.190.0060.00518.76
8.1.180.0020.00919.16
8.1.170.0050.00519.67
8.1.160.0000.01121.25
8.1.150.0050.00719.77
8.1.140.0070.00419.56
8.1.130.0040.00518.78
8.1.120.0060.00518.85
8.1.110.0080.00318.89
8.1.100.0020.00918.90
8.1.90.0040.00718.88
8.1.80.0070.00419.48
8.1.70.0060.00518.73
8.1.60.0060.00619.00
8.1.50.0050.00719.03
8.1.40.0100.00218.86
8.1.30.0070.00518.98
8.1.20.0070.00419.61
8.1.10.0060.00518.94
8.1.00.0070.00418.82
8.0.300.0070.00419.18
8.0.290.0150.00117.20
8.0.280.0090.00918.02
8.0.270.0090.00518.73
8.0.260.0120.00617.84
8.0.250.0130.00417.40
8.0.240.0120.00417.32
8.0.230.0100.00517.41
8.0.220.0080.00417.39
8.0.210.0100.00717.36
8.0.200.0140.00217.48
8.0.190.0110.00617.41
8.0.180.0110.00717.34
8.0.170.0120.00517.27
8.0.160.0090.00518.26
8.0.150.0130.00517.24
8.0.140.0140.00617.13
8.0.130.0110.00515.60
8.0.120.0130.00317.31
8.0.110.0130.00218.31
8.0.100.0050.01317.31
8.0.90.0170.00317.38
8.0.80.0120.00817.20
8.0.70.0070.00718.24
8.0.60.0080.00817.24
8.0.50.0090.00717.23
8.0.30.0050.01118.49
8.0.20.0100.00718.37
8.0.10.0100.00517.53
8.0.00.0140.00919.07
7.4.330.0130.00214.84
7.4.320.0150.00316.96
7.4.300.0150.00317.00
7.4.290.0160.00816.97
7.4.280.0150.00616.64
7.4.270.0190.00516.97
7.4.260.0150.00615.30
7.4.250.0120.00616.99
7.4.240.0140.00216.80
7.4.230.0210.00616.93
7.4.220.0080.00716.88
7.4.210.0110.00816.72
7.4.200.0120.00616.99
7.4.190.0280.01117.55
7.4.180.0210.00617.62
7.4.160.0240.01017.28
7.4.150.0320.00617.52
7.4.140.0250.01317.25
7.4.130.0140.00916.77
7.4.120.0170.01016.84
7.4.110.0190.00716.90
7.4.100.0180.00616.84
7.4.90.0110.01417.13
7.4.80.0240.00818.43
7.4.70.0120.01016.66
7.4.60.0140.00816.72
7.4.50.0170.00816.55
7.4.40.0140.00916.48
7.4.30.0140.00816.58
7.4.20.0140.00816.50
7.4.10.0140.00716.49
7.4.00.0100.00916.53
7.3.330.0110.00716.72
7.3.320.0100.00615.18
7.3.310.0150.00216.64
7.3.300.0110.00516.93
7.3.290.0120.00716.54
7.3.280.0140.01016.75
7.3.270.0260.01217.28
7.3.260.0220.00516.90
7.3.250.0270.00517.32
7.3.240.0110.00916.65
7.3.230.0220.00516.95
7.3.220.0330.00317.11
7.3.210.0200.00616.94
7.3.200.0160.00816.96
7.3.190.0100.01016.65
7.3.180.0130.00916.60
7.3.170.0150.00816.50
7.3.160.0130.00916.47
7.3.150.0120.00916.36
7.3.140.0120.01116.40
7.3.130.0130.00916.56
7.3.120.0120.01016.46
7.3.110.0150.00916.44
7.3.100.0130.01116.34
7.3.90.0140.00816.50
7.3.80.0130.00916.37
7.3.70.0190.00516.42
7.3.60.0140.00816.49
7.3.50.0130.00816.43
7.3.40.0110.01116.44
7.3.30.0110.01116.43
7.3.20.0140.00816.71
7.3.10.0150.00816.67
7.3.00.0150.00916.64
7.2.340.0250.00317.36
7.2.330.0210.00817.13
7.2.320.0220.00916.82
7.2.310.0110.01016.80
7.2.300.0120.01116.69
7.2.290.0160.00816.75
7.2.280.0120.01016.71
7.2.270.0110.01016.58
7.2.260.0110.01016.52
7.2.250.0150.01016.62
7.2.240.0140.01016.65
7.2.230.0130.01016.60
7.2.220.0170.00716.68
7.2.210.0140.00916.63
7.2.200.0130.01116.64
7.2.190.0130.00916.65
7.2.180.0120.01016.68
7.2.170.0120.00916.66
7.2.160.0140.00916.52
7.2.150.0140.01016.95
7.2.140.0150.00916.92
7.2.130.0240.00516.97
7.2.120.0150.01016.91
7.2.110.0120.01116.93
7.2.100.0130.00916.98
7.2.90.0140.01116.87
7.2.80.0150.00916.98
7.2.70.0130.01016.90
7.2.60.0120.00916.94
7.2.50.0110.01216.87
7.2.40.0240.01016.93
7.2.30.0170.00816.95
7.2.20.0130.01017.03
7.2.10.0130.01116.87
7.2.00.0110.00916.83

preferences:
33.38 ms | 404 KiB | 6 Q