3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Point { public $X; public $Y; function __construct($X, $Y) { $this->X = $X; $this->Y = $Y; } } $moves = 10; $mouseX = 200; $mouseY = 200; $point = new Point(300, 300); $delta = 1/(1-rand(0, 99)/100); if (rand(0, 1) == 0) { $delta = 1/$delta; } $xCoefs = array($delta); for ( $i=1; $i<=$moves; $i++ ) { $xCoefs[$i] = $xCoefs[$i-1] - ($delta - 1/$delta)/$moves; } echo $delta.' -> '.(1/$delta)."\r\n"; $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + ($point->X - $mouseX)*$xCoefs[$i-1]/$moves; $y = $points[$i-1]->Y + ($point->Y - $mouseY)/$moves; echo $x.';'.$y.' (coef '.$xCoefs[$i-1].')'."\r\n"; $points[] = new Point($x, $y); }

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)
7.3.10.0180.00216.09
7.3.00.0040.01115.99
7.2.130.0150.01116.47
7.2.120.0180.00616.55
7.2.110.0220.00516.93
7.2.100.0110.00816.13
7.2.90.0180.00316.67
7.2.80.0200.00817.13
7.2.70.0210.01316.54
7.2.60.0200.00816.60
7.2.50.0160.00716.76
7.2.40.0100.01316.59
7.2.30.0190.00616.72
7.2.20.0080.02016.10
7.2.10.0160.00816.04
7.2.00.0100.01118.11
7.1.250.0110.00615.27
7.1.70.0030.00717.33
7.1.60.0140.01119.46
7.1.50.0040.01816.94
7.1.00.0030.07722.30
7.0.200.0000.00816.60
7.0.140.0000.07721.97
7.0.60.0000.08320.05
7.0.50.0030.04017.81
7.0.40.0070.08020.30
7.0.30.0200.04020.12
7.0.20.0230.06320.10
7.0.10.0100.07720.12
7.0.00.0070.04320.07
5.6.280.0030.07721.08
5.6.210.0070.08320.71
5.6.200.0100.08718.13
5.6.190.0070.04320.52
5.6.180.3830.04720.52
5.6.170.0230.07020.54
5.6.160.0030.06720.56
5.6.150.0000.06018.13
5.6.140.0070.08318.27
5.6.130.0000.05718.26
5.6.120.0000.06021.09
5.6.110.0100.08021.02
5.6.100.0030.04021.02
5.6.90.0000.06720.96
5.6.80.0030.04320.38
5.5.350.0230.07320.54
5.5.340.0130.07717.99
5.5.330.0130.07320.43
5.5.320.0170.04720.31
5.5.310.0270.06320.26
5.5.300.0070.03717.98
5.5.290.0130.06017.96
5.5.280.0200.07320.88
5.5.270.0230.06720.64
5.5.260.0100.07720.77
5.5.250.0070.03720.73
5.5.240.0030.03720.27
5.4.450.1030.03319.55
5.4.440.0470.05719.55
5.4.430.0500.03019.47
5.4.420.0900.05019.54
5.4.410.0700.04719.41
5.4.400.0200.03719.10
5.4.390.0700.04019.09
5.4.380.0400.08018.80
5.4.370.0400.05018.74
5.4.360.0530.05718.74
5.4.350.0300.05718.66
5.4.340.0430.07318.63
5.4.320.0050.03812.52
5.4.310.0060.03812.51
5.4.300.0030.03812.52
5.4.290.0060.03812.51
5.4.280.0110.05212.39
5.4.270.0120.06112.39
5.4.260.0110.05112.39
5.4.250.0150.06212.39
5.4.240.0090.05212.39
5.4.230.0080.05312.38
5.4.220.0080.05612.38
5.4.210.0090.05512.38
5.4.200.0080.05812.38
5.4.190.0070.04812.37
5.4.180.0070.04912.38
5.4.170.0090.04912.39
5.4.160.0090.04712.38
5.4.150.0110.05012.38
5.4.140.0130.05412.06
5.4.130.0120.04312.05
5.4.120.0100.05112.01
5.4.110.0140.04812.00
5.4.100.0140.04612.00
5.4.90.0070.05512.00
5.4.80.0140.05212.00
5.4.70.0160.05112.00
5.4.60.0130.06712.00
5.4.50.0150.04912.00
5.4.40.0150.06211.99
5.4.30.0130.06211.98
5.4.20.0100.05411.98
5.4.10.0080.05511.98
5.4.00.0120.05111.47
5.3.290.0050.04412.80
5.3.280.0130.05312.71
5.3.270.0120.05812.72
5.3.260.0100.05912.72
5.3.250.0090.05812.72
5.3.240.0090.05912.72
5.3.230.0080.05712.71
5.3.220.0180.09812.68
5.3.210.0260.06312.68
5.3.200.0160.05812.68
5.3.190.0130.05012.68
5.3.180.0110.03812.67
5.3.170.0140.04112.67
5.3.160.0140.04112.67
5.3.150.0220.06112.67
5.3.140.0130.05012.66
5.3.130.0130.05212.66
5.3.120.0130.05812.66
5.3.110.0110.05512.66
5.3.100.0080.05312.13
5.3.90.0140.05012.11
5.3.80.0090.05112.09
5.3.70.0070.05112.09
5.3.60.0110.04912.08
5.3.50.0070.05112.02
5.3.40.0110.04812.02
5.3.30.0070.05711.98
5.3.20.0080.05111.77
5.3.10.0200.06211.73
5.3.00.0150.05511.72
5.2.170.0050.0429.21
5.2.160.0070.0419.21
5.2.150.0030.0419.21
5.2.140.0060.0339.21
5.2.130.0110.0349.17
5.2.120.0080.0469.17
5.2.110.0090.0429.18
5.2.100.0040.0329.18
5.2.90.0070.0309.17
5.2.80.0080.0429.17
5.2.70.0070.0459.17
5.2.60.0060.0339.12
5.2.50.0050.0439.10
5.2.40.0070.0369.07
5.2.30.0100.0449.05
5.2.20.0170.0319.03
5.2.10.0050.0358.96
5.2.00.0050.0418.83
5.1.60.0100.0338.11
5.1.50.0100.0348.11
5.1.40.0050.0658.09
5.1.30.0070.0398.44
5.1.20.0080.0398.46
5.1.10.0090.0358.18
5.1.00.0080.0388.18
5.0.50.0080.0286.67
5.0.40.0070.0236.53
5.0.30.0090.0416.35
5.0.20.0070.0286.31
5.0.10.0110.0266.29
5.0.00.0090.0396.29
4.4.90.0050.0254.78
4.4.80.0060.0204.76
4.4.70.0080.0214.75
4.4.60.0050.0234.75
4.4.50.0060.0204.77
4.4.40.0070.0344.71
4.4.30.0040.0244.76
4.4.20.0040.0264.85
4.4.10.0040.0264.84
4.4.00.0060.0354.76
4.3.110.0030.0244.67
4.3.100.0050.0234.66
4.3.90.0030.0234.63
4.3.80.0050.0234.58
4.3.70.0040.0154.63
4.3.60.0120.0154.63
4.3.50.0000.0214.62
4.3.40.0050.0344.54
4.3.30.0000.0273.28
4.3.20.0040.0223.26
4.3.10.0060.0223.23
4.3.00.0000.01713.47

preferences:
37.22 ms | 401 KiB | 5 Q