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); $startAngle = rand(0, 90); $angles = array($startAngle); for ( $i=1; $i<$moves; $i++ ) { $angles[$i] = $angles[$i-1] + (90 - 2*$startAngle)/($moves-1); } $lineHeightDiv = 0; foreach ( $angles as $angle ) { $lineHeightDiv += sin($angle*pi()/180); } $lineHeight = ($point->Y-$mouseY)/$moves; $lineWidthDiv = 0; foreach ( $angles as $angle ) { $lineWidthDiv += cos($angle*pi()/180); } $lineWidth = ($point->X - $mouseX)/$moves; $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + $lineWidth; $y = $points[$i-1]->Y + $lineHeight; $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.4.00.0090.00914.93
7.3.120.0090.00914.91
7.3.110.0060.01315.35
7.3.100.0070.01015.13
7.3.90.0150.00015.34
7.3.80.0040.01415.20
7.3.70.0110.00314.90
7.3.60.0080.00815.25
7.3.50.0090.00915.22
7.3.40.0070.01115.39
7.3.30.0060.00915.10
7.3.20.0040.00716.95
7.3.10.0130.00317.06
7.3.00.0120.00617.03
7.2.250.0180.00315.61
7.2.240.0140.00715.46
7.2.230.0000.01315.49
7.2.220.0060.01315.17
7.2.210.0090.00615.60
7.2.200.0060.00915.14
7.2.190.0080.00515.50
7.2.180.0120.00615.46
7.2.170.0090.00915.15
7.1.330.0000.01515.93
7.1.320.0070.00716.12
7.1.310.0090.00915.89
7.1.300.0110.00415.92
7.1.290.0000.01816.12
7.1.280.0070.00715.77
7.1.270.0130.00315.93
7.1.260.0030.01015.77
7.1.70.0130.00417.56
7.1.60.0140.01019.46
7.1.50.0160.01017.03
7.1.00.0000.08022.79
7.0.200.0000.00716.71
7.0.140.0030.07022.25
7.0.110.0100.05720.23
7.0.100.0100.07020.27
7.0.90.0130.07320.16
7.0.80.0030.05320.05
7.0.70.0100.05020.02
7.0.60.0230.04320.14
7.0.50.0030.05320.04
7.0.40.0100.05719.90
7.0.30.0070.07719.85
7.0.20.0070.08719.94
7.0.10.0130.07319.91
7.0.00.0070.07719.82
5.6.280.0030.07321.23
5.6.260.0070.05020.99
5.6.250.0230.06720.83
5.6.240.0030.08320.74
5.6.230.0000.08720.88
5.6.220.0200.07320.86
5.6.210.0130.07320.97
5.6.200.0030.05320.84
5.6.190.0130.07320.87
5.6.180.0100.05020.86
5.6.170.0100.08720.79
5.6.160.0170.07320.64
5.6.150.0000.08720.88
5.6.140.0100.08020.79
5.6.130.0030.09320.95
5.6.120.0000.08720.82
5.6.110.0070.08320.81
5.6.100.0070.08020.82
5.6.90.0100.07320.74
5.6.80.0070.08020.13
5.6.70.0230.06020.24
5.6.60.0230.05320.16
5.6.50.0130.07320.20
5.6.40.0070.07020.18
5.6.30.0130.07320.09
5.6.20.0070.08320.18
5.6.10.0030.04020.14
5.6.00.0100.07320.45
5.5.380.0100.07717.90
5.5.370.0070.07717.88
5.5.360.0030.09017.68
5.5.350.0070.08017.77
5.5.340.0130.07018.20
5.5.330.0070.05318.28
5.5.320.0100.07018.44
5.5.310.0130.05018.27
5.5.300.0130.06018.11
5.5.290.0100.07318.44
5.5.280.0100.06318.23
5.5.270.0170.07018.06
5.5.260.0000.09318.30
5.5.250.0200.06718.08
5.5.240.0170.06717.53
5.5.230.0130.04017.49
5.5.220.0170.03317.35
5.5.210.0100.07317.58
5.5.200.0030.07717.65
5.5.190.0070.08017.58
5.5.180.0100.04017.63
5.5.160.0070.07717.62
5.5.150.0130.07317.58
5.5.140.0070.07017.59
5.5.130.0130.07017.80
5.5.120.0070.08017.63
5.5.110.0100.07317.60
5.5.100.0100.06717.69
5.5.90.0070.07317.46
5.5.80.0000.08317.65
5.5.70.0170.05717.51
5.5.60.0070.07017.47
5.5.50.0030.07717.54
5.5.40.0130.06717.20
5.5.30.0070.08317.51
5.5.20.0100.04317.39
5.5.10.0130.06717.41
5.5.00.0070.06317.56
5.4.450.0100.07719.52
5.4.440.0130.07019.90
5.4.430.0130.07719.51
5.4.420.0030.05019.59
5.4.410.0100.07719.66
5.4.400.0170.07019.38
5.4.390.0070.07319.17
5.4.380.0100.08019.32
5.4.370.0100.06319.33
5.4.360.0170.07319.19
5.4.350.0030.08019.36
5.4.340.0000.08319.12
5.4.320.0030.08019.20
5.4.310.0070.06019.45
5.4.300.0170.06719.19
5.4.290.0130.05319.21
5.4.280.0070.07319.12
5.4.270.0170.06719.14
5.4.260.0030.05019.38
5.4.250.0030.08019.30
5.4.240.0100.07719.14
5.4.230.0030.08319.36
5.4.220.0170.06319.20
5.4.210.0130.04719.14
5.4.200.0070.07719.31
5.4.190.0070.07319.11
5.4.180.0100.08019.30
5.4.170.0070.04319.20
5.4.160.0000.05019.42
5.4.150.0030.08319.10
5.4.140.0070.07016.68
5.4.130.0070.07716.54
5.4.120.0130.06316.59
5.4.110.0130.06716.60
5.4.100.0070.07316.60
5.4.90.0070.07316.75
5.4.80.0000.07716.66
5.4.70.0100.06716.75
5.4.60.0070.06716.74
5.4.50.0000.07316.79
5.4.40.0000.07316.66
5.4.30.0030.07316.53
5.4.20.0100.07316.70
5.4.10.0070.07016.83
5.4.00.0030.04316.16
5.3.290.0070.08015.01
5.3.280.0070.07014.93
5.3.270.0170.06714.79
5.3.260.0000.07714.71
5.3.250.0030.05014.94
5.3.240.0100.07014.79
5.3.230.0070.07714.94
5.3.220.0030.04714.97
5.3.210.0030.07714.96
5.3.200.0100.07014.86
5.3.190.0070.08314.83
5.3.180.0170.06314.82
5.3.170.0170.06714.99
5.3.160.0070.07314.72
5.3.150.0000.04014.76
5.3.140.0030.04314.77
5.3.130.0070.04314.90
5.3.120.0070.07714.98
5.3.110.0100.07314.94
5.3.100.0030.04314.22
5.3.90.0070.03714.30
5.3.80.0000.03714.45
5.3.70.0130.04314.32
5.3.60.0130.04314.30
5.3.50.0030.07314.14
5.3.40.0170.06314.14
5.3.30.0100.06014.26
5.3.20.0070.07013.84
5.3.10.0100.06714.09
5.3.00.0130.06713.99
5.2.170.0030.05311.41
5.2.160.0030.04311.43
5.2.150.0130.05711.36
5.2.140.0070.06011.49
5.2.130.0000.06711.25
5.2.120.0130.05311.38
5.2.110.0030.06311.44
5.2.100.0030.06011.36
5.2.90.0100.06011.29
5.2.80.0070.06311.36
5.2.70.0030.06311.30
5.2.60.0200.04711.33
5.2.50.0000.07011.18
5.2.40.0070.03711.26
5.2.30.0070.05311.20
5.2.20.0000.04311.29
5.2.10.0100.05311.20
5.2.00.0030.05311.07
5.1.60.0070.04310.28
5.1.50.0000.06010.27
5.1.40.0000.05710.15
5.1.30.0030.03310.62
5.1.20.0100.06310.53
5.1.10.0070.04710.36
5.1.00.0130.04310.52
5.0.50.0070.0339.01
5.0.40.0070.0408.59
5.0.30.0030.0638.38
5.0.20.0000.0308.66
5.0.10.0030.0378.55
5.0.00.0000.0638.43
4.4.90.0070.0307.10
4.4.80.0030.0337.10
4.4.70.0070.0337.10
4.4.60.0030.0377.10
4.4.50.0000.0377.10
4.4.40.0030.0507.10
4.4.30.0070.0237.10
4.4.20.0030.0307.10
4.4.10.0070.0207.10
4.4.00.0030.0477.10
4.3.110.0070.0337.10
4.3.100.0030.0277.10
4.3.90.0070.0307.10
4.3.80.0100.0207.10
4.3.70.0000.0207.10
4.3.60.0030.0337.10
4.3.50.0030.0277.10
4.3.40.0030.0377.10
4.3.30.0000.0407.10
4.3.20.0000.0307.10
4.3.10.0030.0337.10
4.3.00.0030.0277.10

preferences:
41.97 ms | 400 KiB | 5 Q