3v4l.org

run code in 300+ PHP versions simultaneously
<?php function keys_with_reference(array $array) { $clone = $array; $testObject = new \stdClass; $keys_with_reference = array(); foreach ($array as $k => $v) { $clone[$k] = $testObject; if ($array[$k] === $testObject) { $array[$k] = $v; $keys_with_reference[$k] = TRUE; } } return $keys_with_reference; } $x = array( 'left' => array(), 'right' => array(), ); print_r(keys_with_reference($x)); &$x['left']; print_r(keys_with_reference($x)); $left = &$x['left']; print_r(keys_with_reference($x));

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)
5.6.100.0100.04720.99
5.6.90.0100.07720.98
5.6.80.0070.08320.38
5.5.260.0130.07320.84
5.5.250.0070.06720.71
5.5.240.0030.03020.04
5.4.420.0070.06019.42
5.4.410.0030.06019.44
5.4.400.0100.05019.14
5.4.390.0170.04718.99
5.4.380.0100.05319.16
5.4.370.0130.05019.06
5.4.360.0100.05019.07
5.4.350.0030.06019.07
5.4.340.0130.04719.07
5.4.320.0170.04719.12
5.4.310.0070.05719.07
5.4.300.0100.05319.23
5.4.290.0100.05319.13
5.4.280.0100.05319.13
5.4.270.0070.05319.04
5.4.260.0100.05319.15
5.4.250.0030.06019.02
5.4.240.0070.05719.12
5.4.230.0070.05719.10
5.4.220.0200.04719.05
5.4.210.0130.07019.05
5.4.200.0130.04716.86
5.4.190.0130.07019.04
5.4.180.0100.05319.14
5.4.170.0130.05019.05
5.4.160.0100.05019.07
5.4.150.0070.05719.02
5.4.140.0070.05316.44
5.4.130.0130.04316.63
5.4.120.0030.05316.32
5.4.110.0130.04716.29
5.4.100.0070.05316.25
5.4.90.0130.05016.56
5.4.80.0270.03716.42
5.4.70.0030.06016.45
5.4.60.0100.04716.40
5.4.50.0030.05316.23
5.4.40.0100.05016.52
5.4.30.0100.04716.59
5.4.20.0030.05716.21
5.4.10.0100.04716.37
5.4.00.0100.05015.70
5.3.290.0070.05714.73
5.3.280.0130.05014.83
5.3.270.0070.05714.71
5.3.260.0170.04714.65
5.3.250.0100.05014.68
5.3.240.0070.05714.64
5.3.230.0100.05014.61
5.3.220.0230.03714.63
5.3.210.0070.05314.70
5.3.200.0170.04314.79
5.3.190.0070.05714.48
5.3.180.0070.05314.64
5.3.170.0130.05014.73
5.3.160.0170.04314.54
5.3.150.0100.05014.68
5.3.140.0130.04314.53
5.3.130.0130.05014.68
5.3.120.0170.05314.68
5.3.110.0100.05314.57
5.3.100.0100.04713.95
5.3.90.0070.05314.19
5.3.80.0030.05714.24
5.3.70.0130.04714.23
5.3.60.0130.06313.97
5.3.50.0330.04314.02
5.3.40.0070.05013.91
5.3.30.0070.05313.82
5.3.20.0030.05713.61
5.3.10.0070.05013.72
5.3.00.0100.04713.66
5.2.170.0070.04011.33
5.2.160.0070.04011.06
5.2.150.0030.04311.00
5.2.140.0000.04711.05
5.2.130.0030.04311.27
5.2.120.0100.03711.17
5.2.110.0170.03011.16
5.2.100.0070.04011.02
5.2.90.0100.03711.16
5.2.80.0130.03711.06
5.2.70.0100.03710.95
5.2.60.0230.02710.95
5.2.50.0070.04011.17
5.2.40.0000.04710.95
5.2.30.0100.03711.08
5.2.20.0070.04010.99
5.2.10.0170.02710.71
5.2.00.0130.03310.82
5.1.60.0070.03310.00
5.1.50.0100.0309.89
5.1.40.0030.03710.08
5.1.30.0070.03710.32
5.1.20.0070.03710.34
5.1.10.0030.03710.21
5.1.00.0130.0309.98
5.0.50.0070.0278.47
5.0.40.0030.0278.56
5.0.30.0030.0478.11
5.0.20.0070.0308.20
5.0.10.0070.0238.16
5.0.00.0100.0378.09
4.4.90.0030.0235.75
4.4.80.0070.0205.88
4.4.70.0070.0205.87
4.4.60.0000.0235.87
4.4.50.0030.0205.86
4.4.40.0000.0375.90
4.4.30.0100.0135.75
4.4.20.0030.0205.91
4.4.10.0000.0235.84
4.4.00.0030.0335.93
4.3.110.0030.0235.84
4.3.100.0000.0235.85
4.3.90.0070.0175.81
4.3.80.0030.0335.80
4.3.70.0000.0235.80
4.3.60.0000.0275.79
4.3.50.0070.0205.80
4.3.40.0100.0305.75
4.3.30.0070.0204.43
4.3.20.0030.0204.40
4.3.10.0000.0234.54
4.3.00.0330.00715.32

preferences:
130.81 ms | 1398 KiB | 7 Q