3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wrap( $arr){ test( $arr); } function test( $arr){ $refs = array(); // Array of references that we've seen $f = function( $arr) use( &$refs, &$f) { $refs[] = $arr; foreach( $arr as $v) { if( in_array( $v, $refs)) { print 'ref, '; } else { if( is_array( $v)) { $f( $v); } else { print $v . ', '; } } } }; $f( $arr); } $array = array(1, 2, array(1, 2), array(1, 2)); wrap( $array);

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.0130.00718.43
8.3.50.0070.01222.09
8.3.40.0050.01018.79
8.3.30.0180.00018.91
8.3.20.0040.00420.14
8.3.10.0000.00822.14
8.3.00.0040.00422.52
8.2.180.0070.01116.88
8.2.170.0100.00322.96
8.2.160.0110.00420.85
8.2.150.0040.00424.18
8.2.140.0110.00424.66
8.2.130.0000.00726.16
8.2.120.0030.00619.36
8.2.110.0000.00922.31
8.2.100.0080.00417.91
8.2.90.0000.00919.21
8.2.80.0000.00918.05
8.2.70.0060.00317.63
8.2.60.0060.00318.03
8.2.50.0080.00018.07
8.2.40.0060.00318.16
8.2.30.0000.00718.19
8.2.20.0040.00417.81
8.2.10.0080.00019.39
8.2.00.0030.00517.63
8.1.280.0150.00425.92
8.1.270.0080.00023.87
8.1.260.0050.00326.35
8.1.250.0140.00428.09
8.1.240.0090.00023.77
8.1.230.0080.00418.96
8.1.220.0080.00017.88
8.1.210.0050.00318.77
8.1.200.0000.00917.35
8.1.190.0080.00017.53
8.1.180.0080.00018.10
8.1.170.0080.00318.70
8.1.160.0000.00722.02
8.1.150.0060.00318.64
8.1.140.0040.00417.37
8.1.130.0000.00717.71
8.1.120.0070.00017.48
8.1.110.0000.00717.49
8.1.100.0000.00717.32
8.1.90.0030.00317.46
8.1.80.0000.00717.37
8.1.70.0070.00017.46
8.1.60.0000.00817.49
8.1.50.0050.00317.45
8.1.40.0080.00017.48
8.1.30.0030.00617.52
8.1.20.0030.00517.67
8.1.10.0040.00417.48
8.1.00.0000.00817.54
8.0.300.0040.00418.77
8.0.290.0050.00317.05
8.0.280.0000.00818.44
8.0.270.0050.00217.18
8.0.260.0030.00316.75
8.0.250.0030.00316.95
8.0.240.0000.00716.83
8.0.230.0040.00416.85
8.0.220.0030.00316.92
8.0.210.0000.00716.81
8.0.200.0000.00817.02
8.0.190.0060.00316.96
8.0.180.0000.00816.96
8.0.170.0000.00816.95
8.0.160.0050.00216.76
8.0.150.0040.00416.69
8.0.140.0030.00316.79
8.0.130.0030.00313.34
8.0.120.0000.00816.86
8.0.110.0000.00716.87
8.0.100.0000.00716.73
8.0.90.0000.00816.96
8.0.80.0150.00016.82
8.0.70.0000.00716.89
8.0.60.0000.00716.70
8.0.50.0050.00216.76
8.0.30.0070.01417.04
8.0.20.0140.01317.40
8.0.10.0000.00817.04
8.0.00.0110.01316.94
7.4.330.0040.00215.03
7.4.320.0070.00016.62
7.4.300.0030.00316.64
7.4.290.0080.00016.52
7.4.280.0000.00716.51
7.4.270.0090.00016.41
7.4.260.0000.00816.51
7.4.250.0070.00016.43
7.4.240.0020.00516.52
7.4.230.0000.00716.64
7.4.220.0170.01816.70
7.4.210.0080.00916.58
7.4.200.0070.00016.63
7.4.190.0050.00316.46
7.4.160.0100.00716.69
7.4.150.0120.00617.40
7.4.140.0110.00717.86
7.4.130.0150.00216.57
7.4.120.0070.01216.55
7.4.110.0090.00916.40
7.4.100.0090.00616.62
7.4.90.0090.00916.44
7.4.80.0070.01016.59
7.4.70.0170.00016.46
7.4.60.0140.00316.54
7.4.50.0030.00316.25
7.4.40.0070.01022.77
7.4.30.0080.00816.30
7.4.00.0060.01015.17
7.3.330.0030.00313.29
7.3.320.0020.00213.13
7.3.310.0070.00016.20
7.3.300.0040.00216.19
7.3.290.0120.00316.36
7.3.280.0040.01316.27
7.3.270.0080.00817.40
7.3.260.0090.00916.53
7.3.250.0050.01416.45
7.3.240.0060.01216.40
7.3.230.0100.00716.59
7.3.210.0090.00916.55
7.3.200.0080.01219.39
7.3.190.0110.00716.31
7.3.180.0100.00616.68
7.3.170.0120.01016.58
7.3.160.0070.01016.57
7.3.120.0060.01015.09
7.3.10.0040.00816.72
7.3.00.0040.00816.77
7.2.330.0130.00316.72
7.2.320.0140.00816.74
7.2.310.0060.01616.36
7.2.300.0130.01316.68
7.2.290.0100.00716.77
7.2.130.0060.00616.86
7.2.120.0090.00616.95
7.2.110.0080.00416.72
7.2.100.0050.00317.01
7.2.90.0040.01116.96
7.2.80.0030.00916.88
7.2.70.0030.01017.00
7.2.60.0110.00417.03
7.2.50.0070.01116.89
7.2.40.0070.00717.05
7.2.30.0090.00617.08
7.2.20.0030.00816.73
7.2.10.0030.01016.86
7.2.00.0020.00918.13
7.1.250.0030.00615.71
7.1.100.0090.00618.35
7.1.70.0030.01017.18
7.1.60.0070.01419.82
7.1.50.0060.01616.98
7.1.00.0000.08022.54
7.0.200.0050.00316.77
7.0.140.0100.06721.99
7.0.70.0070.04721.80
7.0.60.0000.07721.83
7.0.50.0000.04322.01
7.0.40.0030.03320.10
7.0.30.0030.04320.10
7.0.20.0030.03720.18
7.0.10.0000.04720.05
7.0.00.0030.05720.07
5.6.280.0070.07020.83
5.6.220.0100.03320.63
5.6.210.0000.04320.75
5.6.200.0030.04021.04
5.6.190.0030.04321.18
5.6.180.0000.08021.02
5.6.170.0100.07321.05
5.6.160.0070.07320.94
5.6.150.0070.03721.07
5.6.140.0070.06321.14
5.6.130.0000.04321.05
5.6.120.0030.04021.02
5.6.110.0000.04321.02
5.6.100.0000.05321.13
5.6.90.0030.04020.92
5.6.80.0000.04020.43
5.6.70.0070.05320.49
5.6.60.0000.08320.45
5.6.50.0070.07320.53
5.6.40.0000.04320.44
5.6.30.0030.07720.30
5.6.20.0000.07720.38
5.6.10.0030.06320.33
5.6.00.0030.06720.37
5.5.360.0130.02720.45
5.5.350.0070.05720.39
5.5.340.0000.04320.84
5.5.330.0000.04320.84
5.5.320.0000.04720.93
5.5.310.0030.04020.86
5.5.300.0000.03720.95
5.5.290.0030.03320.86
5.5.280.0100.06020.91
5.5.270.0070.03020.92
5.5.260.0000.03720.92
5.5.250.0070.03020.74
5.5.240.0000.04020.26
5.5.230.0030.04020.18
5.5.220.0030.05020.15
5.5.210.0070.08020.31
5.5.200.0130.07020.13
5.5.190.0000.05720.24
5.5.180.0000.04320.28
5.5.160.0000.04320.20
5.5.150.0070.07720.18
5.5.140.0070.08020.28
5.5.130.0030.06720.22
5.5.120.0030.06720.24
5.5.110.0030.08020.22
5.5.100.0070.07720.08
5.5.90.0030.08019.98
5.5.80.0070.07020.16
5.5.70.0130.04320.05
5.5.60.0030.05020.06
5.5.50.0000.08320.15
5.5.40.0030.07320.04
5.5.30.0000.06320.05
5.5.20.0070.07720.09
5.5.10.0030.08020.05
5.5.00.0000.08019.98
5.4.450.0030.04319.21
5.4.440.0070.05319.54
5.4.430.0030.03719.55
5.4.420.0000.04019.22
5.4.410.0070.03319.29
5.4.400.0030.03719.14
5.4.390.0030.04019.09
5.4.380.0000.03718.90
5.4.370.0030.07318.85
5.4.360.0070.06719.03
5.4.350.0070.06719.02
5.4.340.0070.03319.04
5.4.320.0030.06319.18
5.4.310.0030.06019.05
5.4.300.0070.07019.04
5.4.290.0030.05019.21
5.4.280.0100.05718.94
5.4.270.0130.06719.18
5.4.260.0000.07019.12
5.4.250.0070.04319.12
5.4.240.0200.06718.84
5.4.230.0000.06019.02
5.4.220.0030.07719.23
5.4.210.0030.07718.94
5.4.200.0070.07319.20
5.4.190.0030.07719.02
5.4.180.0030.07718.89
5.4.170.0030.07719.12
5.4.160.0030.07318.93
5.4.150.0030.08018.88
5.4.140.0030.04016.32
5.4.130.0100.06716.30
5.4.120.0070.06316.30
5.4.110.0000.07716.33
5.4.100.0030.07316.53
5.4.90.0100.06716.39
5.4.80.0070.06016.38
5.4.70.0030.07016.31
5.4.60.0030.04716.36
5.4.50.0000.08016.31
5.4.40.0000.07316.53
5.4.30.0000.05016.41
5.4.20.0100.06316.46
5.4.10.0030.07316.50
5.4.00.0000.07315.78
5.3.290.0070.06714.77
5.3.280.0030.06014.63
5.3.270.0000.09014.64
5.3.260.0030.07314.71
5.3.250.0030.04714.59
5.3.240.0030.05714.56
5.3.230.0000.05314.66
5.3.220.0070.04014.52
5.3.210.0100.05014.55
5.3.200.0100.05714.61
5.3.190.0070.06314.54
5.3.180.0030.07714.53
5.3.170.0030.07314.54
5.3.160.0070.07314.67
5.3.150.0030.07714.68
5.3.140.0030.06014.50
5.3.130.0030.04314.59
5.3.120.0000.08314.57
5.3.110.0100.07014.50
5.3.100.0070.06014.19
5.3.90.0030.07314.17
5.3.80.0000.06014.08
5.3.70.0030.07714.04
5.3.60.0030.07313.94
5.3.50.0070.06313.88
5.3.40.0070.07313.98
5.3.30.0030.07314.06
5.3.20.0100.05313.63
5.3.10.0070.06313.80
5.3.00.0030.04713.63
5.2.170.0000.04012.23
5.2.160.0000.05012.23
5.2.150.0030.06712.23
5.2.140.0030.07012.23
5.2.130.0070.05312.23
5.2.120.0030.03712.23
5.2.110.0130.03712.23
5.2.100.0070.04312.23
5.2.90.0070.05712.23
5.2.80.0000.07012.23
5.2.70.0070.06012.23
5.2.60.0030.06012.23
5.2.50.0070.05712.23
5.2.40.0130.03712.23
5.2.30.0030.06312.23
5.2.20.0030.06312.23
5.2.10.0070.04712.23
5.2.00.0070.05712.23
5.1.60.0070.04012.23
5.1.50.0000.04012.23
5.1.40.0000.04012.23
5.1.30.0000.05012.23
5.1.20.0070.03712.23
5.1.10.0030.03012.23
5.1.00.0000.02712.23
5.0.50.0070.02012.23
5.0.40.0030.03312.23
5.0.30.0000.06712.23
5.0.20.0030.04312.23
5.0.10.0000.02712.23
5.0.00.0030.04312.23
4.4.90.0000.02312.23
4.4.80.0000.03712.23
4.4.70.0000.03712.23
4.4.60.0030.03712.23
4.4.50.0000.02312.23
4.4.40.0000.05712.23
4.4.30.0030.02312.23
4.4.20.0000.02312.23
4.4.10.0000.02012.23
4.4.00.0000.05712.23
4.3.110.0030.02312.23
4.3.100.0000.03012.23
4.3.90.0000.02312.23
4.3.80.0000.05312.23
4.3.70.0030.01312.23
4.3.60.0030.02012.23
4.3.50.0000.03712.23
4.3.40.0000.04712.23
4.3.30.0030.03312.23
4.3.20.0000.03712.23
4.3.10.0030.03712.23
4.3.00.0000.02312.23

preferences:
43.51 ms | 401 KiB | 5 Q