3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Fuckyou { function test() { $orderedids=array(7, 9, 5, 3); $tags=array( new Tag(3), new Tag(7), new Tag(5), new Tag(9) ); $flipped=array_flip($orderedids); class Sorter { public $flipped; function __construct($flipped) { $this->flipped=$flipped; } function fsort($tag1, $tag2) { if ($this->flipped[$tag1->id]<$this->flipped[$tag2->id]) return -1; else if ($this->flipped[$tag1->id]==$this->flipped[$tag2->id]) return 0; else return 1; } } $sorter=new Sorter($flipped); usort($tags, array($sorter, "fsort")); return $tags; } } class Tag { public $id; function __construct($id) { $this->id=$id; } } $f=new Fuckyou(); $rtags=$f->test(); foreach ($rtags as $tag) echo $tag->id." ";

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.0.30.0090.00616.77
8.0.20.0060.01016.87
8.0.10.0040.01216.82
8.0.00.0040.01117.01
7.4.160.0030.01316.47
7.4.150.0110.00316.43
7.4.140.0110.00316.39
7.4.130.0110.00416.18
7.4.120.0000.01316.36
7.4.110.0110.00416.23
7.4.100.0070.00716.43
7.4.90.0070.00716.42
7.4.80.0050.01016.25
7.4.70.0150.00616.17
7.4.60.0070.00716.15
7.4.50.0060.01316.23
7.4.40.0110.00316.04
7.4.30.0120.00316.43
7.4.20.0060.00916.35
7.4.10.0070.01016.22
7.4.00.0090.00916.24
7.3.270.0090.00616.21
7.3.260.0070.00716.27
7.3.250.0030.01016.22
7.3.240.0030.01016.19
7.3.230.0050.01016.11
7.3.220.0100.01016.14
7.3.210.0090.00516.21
7.3.200.0100.01016.13
7.3.190.0030.01116.12
7.3.180.0070.00716.13
7.3.170.0120.00916.18
7.3.160.0070.00716.17
7.3.150.0030.01016.17
7.3.140.0060.00916.18
7.3.130.0030.01916.17
7.3.120.0030.01416.16
7.3.110.0090.00616.13
7.3.100.0070.01316.09
7.3.90.0090.00616.36
7.3.80.0080.01116.13
7.3.70.0070.00716.20
7.3.60.0050.00816.30
7.3.50.0100.01016.27
7.3.40.0060.00816.23
7.3.30.0090.00616.28
7.3.20.0120.00916.32
7.3.10.0110.00916.23
7.3.00.0070.00716.18
7.2.340.0220.00616.15
7.2.330.0200.00316.21
7.2.320.0330.01016.08
7.2.310.0160.00916.16
7.2.300.0180.00716.18
7.2.290.0160.01016.15
7.2.280.0170.01116.16
7.2.270.0110.01716.10
7.2.260.0230.00816.17
7.2.250.0350.01216.18
7.2.240.0240.01016.19
7.2.230.0170.01016.19
7.2.220.0180.00816.16
7.2.210.0350.01216.14
7.2.200.0170.00816.29
7.2.190.0480.00316.31
7.2.180.0140.01716.26
7.2.170.0230.01116.34
7.2.160.0210.00716.33
7.2.150.0290.00816.37
7.2.140.0210.01416.37
7.2.130.0150.01216.61
7.2.120.0180.01216.44
7.2.110.0380.00916.46
7.2.100.0170.01216.52
7.2.90.0380.01916.38
7.2.80.0260.00516.39
7.2.70.0200.01216.43
7.2.60.0230.01316.29
7.2.50.0180.01516.37
7.2.40.0200.00716.48
7.2.30.0230.00516.49
7.2.20.0180.00816.44
7.2.10.0150.01516.46
7.2.00.0160.00816.43
7.1.330.0200.01115.42
7.1.320.0190.01015.32
7.1.310.0160.00915.36
7.1.300.0170.01015.38
7.1.290.0320.01115.42
7.1.280.0160.01015.35
7.1.270.0100.01315.38
7.1.260.0280.00615.27
7.1.250.0160.00815.24
7.1.240.0140.01415.33
7.1.230.0140.01015.34
7.1.220.0190.00515.30
7.1.210.0200.00415.23
7.1.200.0160.01015.34
7.1.190.0220.00615.36
7.1.180.0210.00415.26
7.1.170.0160.01415.27
7.1.160.0200.00415.21
7.1.150.0120.01215.22
7.1.140.0160.01215.27
7.1.130.0230.00015.33
7.1.120.0210.00315.33
7.1.110.0150.00715.14
7.1.100.0170.00815.15
7.1.90.0180.00615.27
7.1.80.0220.00615.23
7.1.70.0460.01215.09
7.1.60.0160.00915.24
7.1.50.0250.00515.30
7.1.40.0270.00315.34
7.1.30.0160.00815.21
7.1.20.0140.01115.09
7.1.10.0220.00315.17
7.1.00.0160.01315.08
7.0.330.0140.01115.00
7.0.320.0160.01314.93
7.0.310.0170.00715.00
7.0.300.0160.01314.98
7.0.290.0280.00714.98
7.0.280.0170.01014.95
7.0.270.0170.00714.98
7.0.260.0260.00314.96
7.0.250.0090.01215.19
7.0.240.0140.01415.04
7.0.230.0180.00715.09
7.0.220.0150.01215.14
7.0.210.0100.02115.13
7.0.200.0210.00415.14
7.0.190.0240.00715.05
7.0.180.0150.00915.11
7.0.170.0150.01215.16
7.0.160.0180.00714.98
7.0.150.0150.00914.95
7.0.140.0210.00315.05
7.0.130.0220.00615.03
7.0.120.0110.01415.06
7.0.110.0210.00515.04
7.0.100.0120.01214.88
7.0.90.0560.00714.89
7.0.80.0160.00814.99
7.0.70.0120.01515.00
7.0.60.0250.00615.03
7.0.50.0180.00914.92
7.0.40.0160.00815.10
7.0.30.0170.01115.04
7.0.20.0200.00815.02
7.0.10.0140.01015.04
7.0.00.0180.00514.96
5.6.400.0190.01215.59
5.6.390.0210.00815.64
5.6.380.0220.00615.62
5.6.370.0190.00915.56
5.6.360.0090.02215.73
5.6.350.0120.01215.75
5.6.340.0140.01415.56
5.6.330.0160.00915.59
5.6.320.0110.01115.75
5.6.310.0120.01515.56
5.6.300.0190.01415.45
5.6.290.0130.01315.55
5.6.280.0140.01415.60
5.6.270.0180.00915.58
5.6.260.0200.00615.50
5.6.250.0140.01215.61
5.6.240.0130.01315.63
5.6.230.0130.01315.56
5.6.220.0140.01215.61
5.6.210.0190.00915.60
5.6.200.0250.00415.66
5.6.190.0150.01515.71
5.6.180.0160.01015.70
5.6.170.0240.00715.70
5.6.160.0200.00715.72
5.6.150.0100.04516.96
5.6.140.0140.04017.04
5.6.130.0080.03816.96
5.6.120.0220.03018.35
5.6.110.0130.04718.38
5.6.100.0150.04218.32
5.6.90.0150.04018.31
5.6.80.0100.04518.13
5.6.70.0210.00315.83
5.6.60.0180.01115.68
5.6.50.0060.02015.55
5.6.40.0110.02115.60
5.6.30.0230.01015.61
5.6.20.0170.01415.65
5.6.10.0210.01415.41
5.6.00.0200.00815.57
5.5.380.0180.01215.64
5.5.370.0160.01015.70
5.5.360.0210.00915.39
5.5.350.0340.00415.54
5.5.340.0240.00615.38
5.5.330.0200.01215.48
5.5.320.0140.01415.46
5.5.310.0230.00715.56
5.5.300.0130.05016.78
5.5.290.0150.02116.80
5.5.280.0150.03218.17
5.5.270.0180.03118.09
5.5.260.0150.02318.11
5.5.250.0120.04318.09
5.5.240.0130.02517.92
5.5.230.0150.01015.61
5.5.220.0130.01315.71
5.5.210.0140.01115.66
5.5.200.0200.01015.36
5.5.190.0120.01315.44
5.5.180.0210.00915.41
5.5.170.0160.01615.44
5.5.160.0190.01415.59
5.5.150.0080.02015.35
5.5.140.0130.01315.30
5.5.130.0210.01415.34
5.5.120.0130.01915.30
5.5.110.0180.01515.29
5.5.100.0190.01315.52
5.5.90.0180.00915.53
5.5.80.0160.01615.56
5.5.70.0220.00615.64
5.5.60.0190.01215.54
5.5.50.0360.01815.51
5.5.40.0390.03715.52
5.5.30.0550.02115.53
5.5.20.0290.01515.53
5.5.10.0120.01615.40
5.5.00.0220.00415.52
5.4.450.0240.00312.40
5.4.440.0090.00912.48
5.4.430.0130.00512.45
5.4.420.0140.00712.38
5.4.410.0090.00912.47
5.4.400.0070.01112.35
5.4.390.0100.00712.42
5.4.380.0140.00712.35
5.4.370.0070.01112.31
5.4.360.0170.00512.32
5.4.350.0220.00612.33
5.4.340.0130.00712.41
5.4.330.0110.01112.51
5.4.320.0150.00512.46
5.4.310.0180.00312.50
5.4.300.0180.00612.45
5.4.290.0110.01112.46
5.4.280.0140.00912.48
5.4.270.0170.00712.45
5.4.260.0170.00612.44
5.4.250.0130.00612.33
5.4.240.0180.00412.39
5.4.230.0200.00312.22
5.4.220.0260.00012.22
5.4.210.0330.02012.20
5.4.200.0210.01812.17
5.4.190.0090.01212.22
5.4.180.0080.01312.20
5.4.170.0360.00512.30
5.4.160.0170.00612.26
5.4.150.0140.01012.20
5.4.140.0110.00812.39
5.4.130.0140.01012.45
5.4.120.0120.00912.46
5.4.110.0250.00312.43
5.4.100.0170.00312.42
5.4.90.0210.00312.36
5.4.80.0120.00812.51
5.4.70.0080.01212.54
5.4.60.0260.01412.53
5.4.50.0170.00712.38
5.4.40.0140.00912.32
5.4.30.0130.01012.48
5.4.20.0160.01112.47
5.4.10.0110.01112.38
5.4.00.0120.00912.34
5.3.290.0190.00312.91
5.3.280.0140.01012.79
5.3.270.0160.00812.71
5.3.260.0120.01212.73
5.3.250.0170.00512.89
5.3.240.0090.01712.68
5.3.230.0270.01912.60
5.3.220.0150.00912.80
5.3.210.0120.01212.71
5.3.200.0110.01112.70
5.3.190.0100.01012.77
5.3.180.0130.01312.79
5.3.170.0100.01312.85
5.3.160.0150.01112.88
5.3.150.0250.00612.98
5.3.140.0140.00912.92
5.3.130.0130.01312.79
5.3.120.0130.00912.79
5.3.110.0090.01712.83
5.3.100.0150.00812.91
5.3.90.0150.00512.82
5.3.80.0090.01212.84
5.3.70.0170.00512.98
5.3.60.0080.02512.91
5.3.50.0170.01012.74
5.3.40.0160.00812.82
5.3.30.0150.00812.68
5.3.20.0160.00912.73
5.3.10.0180.00812.49
5.3.00.0110.00712.61
5.2.170.0130.00411.82
5.2.160.0070.01511.94
5.2.150.0040.00711.92
5.2.140.0130.00811.86
5.2.130.0090.00211.72
5.2.120.0140.01011.73
5.2.110.0100.01211.85
5.2.100.0110.00911.86
5.2.90.0110.00912.02
5.2.80.0120.00511.66
5.2.70.0230.00511.69
5.2.60.0150.00611.88
5.2.50.0130.01211.70
5.2.40.0100.01011.83
5.2.30.0120.01111.79
5.2.20.0090.01511.79
5.2.10.0110.01111.50
5.2.00.0130.00811.41
5.1.60.0100.00511.13
5.1.50.0060.01011.13
5.1.40.0100.00711.13
5.1.30.0110.00511.13
5.1.20.0150.01111.13
5.1.10.0070.01211.13
5.1.00.0120.00511.13
5.0.50.0110.00611.13
5.0.40.0080.00811.13
5.0.30.0100.00711.13
5.0.20.0040.01211.13
5.0.10.0070.01211.13
5.0.00.0150.00011.13
4.4.90.0050.00511.13
4.4.80.0050.00511.13
4.4.70.0080.00311.13
4.4.60.0090.00311.13
4.4.50.0080.00311.13
4.4.40.0030.00611.13
4.4.30.0080.00011.13
4.4.20.0070.00211.13
4.4.10.0040.00511.13
4.4.00.0040.00811.13
4.3.110.0000.01011.13
4.3.100.0030.00611.13
4.3.90.0070.00311.13
4.3.80.0000.01011.13
4.3.70.0090.00211.13
4.3.60.0060.00611.13
4.3.50.0040.00711.13
4.3.40.0070.00311.13
4.3.30.0030.00611.13
4.3.20.0040.00411.13
4.3.10.0120.00411.13
4.3.00.0060.00511.13

preferences:
146.93 ms | 1386 KiB | 7 Q