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 = 100; $mouseY = 100; $point = new Point(200, 200); $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; } $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + ($point->X - $mouseX)*$xCoefs[$i]/$moves; $y = $points[$i-1]->Y + ($point->Y - $mouseY)/$moves; $points[] = new Point($x, $y); } var_dump($points);

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.2.00.0120.00819.36
7.1.70.0040.00417.18
7.1.60.0110.00416.96
7.1.50.0100.01316.99
7.1.00.0070.07022.24
7.0.200.0130.00316.68
7.0.140.0030.06722.10
7.0.60.0130.03320.06
7.0.50.0070.03718.00
7.0.40.0100.08020.29
7.0.30.0300.04020.07
7.0.20.0170.04020.25
7.0.10.0200.07320.17
7.0.00.0070.08320.10
5.6.280.0030.07320.90
5.6.210.0030.05720.74
5.6.200.0100.07718.27
5.6.190.0070.06720.51
5.6.180.0330.07020.61
5.6.170.0270.07320.44
5.6.160.0070.08720.39
5.6.150.0070.08018.18
5.6.140.0070.07718.14
5.6.130.0170.07018.12
5.6.120.0070.03721.11
5.6.110.0130.08020.99
5.6.100.0000.04321.03
5.6.90.0070.05720.98
5.6.80.0230.06720.36
5.6.70.4370.04020.44
5.5.350.0100.07320.54
5.5.340.0030.05317.98
5.5.330.0000.09020.21
5.5.320.0130.07020.26
5.5.310.0200.07320.37
5.5.300.0030.07317.98
5.5.290.0070.04318.09
5.5.280.0100.07720.74
5.5.270.0100.09020.98
5.5.260.0030.04020.88
5.5.250.0070.08020.62
5.5.240.0170.04020.20
5.4.450.0830.06019.45
5.4.440.0730.06319.63
5.4.430.0700.07319.55
5.4.420.0170.07019.45
5.4.410.0600.05319.45
5.4.400.0170.05319.16
5.4.390.0770.05319.13
5.4.380.0470.05318.74
5.4.370.0200.05718.78
5.4.360.0270.05318.57
5.4.350.0230.06718.76
5.4.340.0370.04718.53
5.4.320.0040.03912.52
5.4.310.0060.03812.51
5.4.300.0080.03512.52
5.4.290.0040.03912.51
5.4.280.0070.06112.39
5.4.270.0130.06212.39
5.4.260.0100.06412.38
5.4.250.0120.06712.39
5.4.240.0060.04112.39
5.4.230.0120.03712.38
5.4.220.0050.05212.38
5.4.210.0090.04112.38
5.4.200.0120.04412.38
5.4.190.0120.05912.37
5.4.180.0100.05712.38
5.4.170.0190.05212.39
5.4.160.0130.05012.38
5.4.150.0090.05912.38
5.4.140.0070.05512.06
5.4.130.0090.04112.05
5.4.120.0080.04012.01
5.4.110.0080.04112.00
5.4.100.0090.05112.00
5.4.90.0100.05612.00
5.4.80.0100.05312.00
5.4.70.0130.04912.00
5.4.60.0130.04912.00
5.4.50.0140.04112.00
5.4.40.0120.04311.99
5.4.30.0100.03811.98
5.4.20.0120.03511.99
5.4.10.0120.04211.98
5.4.00.0080.03911.48
5.3.290.0060.03912.80
5.3.280.0110.05412.71
5.3.270.0110.05512.72
5.3.260.0140.05312.71
5.3.250.0070.06212.72
5.3.240.0130.06912.72
5.3.230.0060.06512.71
5.3.220.0150.06112.68
5.3.210.0150.08312.68
5.3.200.0090.06212.68
5.3.190.0060.06612.68
5.3.180.0080.06112.67
5.3.170.0130.05612.67
5.3.160.0120.06012.67
5.3.150.0160.11312.67
5.3.140.0110.04012.66
5.3.130.0080.04912.66
5.3.120.0120.04112.66
5.3.110.0140.05612.66
5.3.100.0090.04512.13
5.3.90.0100.03912.11
5.3.80.0180.05412.09
5.3.70.0120.05412.09
5.3.60.0120.05812.07
5.3.50.0160.05812.02
5.3.40.0080.04912.02
5.3.30.0120.05011.98
5.3.20.0100.05211.76
5.3.10.0110.03411.73
5.3.00.0070.03911.72
5.2.170.0120.0319.21
5.2.160.0040.0339.21
5.2.150.0060.0339.21
5.2.140.0050.0339.21
5.2.130.0060.0309.17
5.2.120.0070.0309.17
5.2.110.0050.0379.18
5.2.100.0060.0309.18
5.2.90.0100.0429.18
5.2.80.0070.0339.17
5.2.70.0110.0299.16
5.2.60.0080.0319.12
5.2.50.0070.0329.09
5.2.40.0080.0599.07
5.2.30.0070.0449.05
5.2.20.0080.0299.03
5.2.10.0060.0388.94
5.2.00.0070.0418.81
5.1.60.0090.0328.09
5.1.50.0130.0338.09
5.1.40.0080.0288.07
5.1.30.0070.0378.42
5.1.20.0070.0408.45
5.1.10.0100.0288.17
5.1.00.0090.0278.17
5.0.50.0050.0236.65
5.0.40.0070.0266.51
5.0.30.0040.0346.33
5.0.20.0060.0186.29
5.0.10.0040.0226.27
5.0.00.0040.0336.26
4.4.90.0070.0384.78
4.4.80.0040.0224.76
4.4.70.0060.0274.75
4.4.60.0060.0204.76
4.4.50.0060.0274.77
4.4.40.0060.0394.71
4.4.30.0050.0214.76
4.4.20.0040.0224.84
4.4.10.0040.0224.85
4.4.00.0030.0334.76
4.3.110.0050.0214.67
4.3.100.0030.0224.66
4.3.90.0010.0234.63
4.3.80.0020.0334.58
4.3.70.0030.0214.63
4.3.60.0050.0254.62
4.3.50.0010.0244.63
4.3.40.0050.0364.53
4.3.30.0030.0223.28
4.3.20.0010.0243.27
4.3.10.0040.0223.23
4.3.00.0270.01710.30

preferences:
29.16 ms | 400 KiB | 5 Q