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 = 4; $mouseX = 0; $mouseY = 0; $point = new Point(400, 400); //$startAngle = rand(0, 90); $startAngle = 30; echo 'Angle = '.$startAngle."\r\n"; $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)/$lineHeightDiv; echo 'LineHeight = '.$lineHeight."\r\n"; $lineWidthDiv = 0; foreach ( $angles as $angle ) { $lineWidthDiv += cos($angle*pi()/180); } $lineWidth = ($point->X-$mouseX)/$lineWidthDiv; echo 'LineWidth = '.$lineWidth."\r\n"; $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + $lineWidth*cos($angles[$i]*pi()/180); $y = $points[$i-1]->Y + $lineHeight*sin($angles[$i]*pi()/180); $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)
8.3.40.0080.00819.21
8.3.30.0110.00419.17
8.3.20.0080.00020.45
8.3.10.0040.00423.89
8.3.00.0040.00419.76
8.2.170.0060.01022.96
8.2.160.0150.00020.77
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0130.00726.16
8.2.120.0070.00322.55
8.2.110.0110.00022.68
8.2.100.0060.00618.28
8.2.90.0000.00819.51
8.2.80.0060.00318.43
8.2.70.0040.00418.00
8.2.60.0030.00518.40
8.2.50.0110.00018.07
8.2.40.0030.00618.47
8.2.30.0050.00318.34
8.2.20.0000.00818.22
8.2.10.0000.00918.30
8.2.00.0030.00718.21
8.1.270.0000.00924.08
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0100.00024.01
8.1.230.0040.00819.46
8.1.220.0000.00818.16
8.1.210.0040.00418.77
8.1.200.0030.00617.72
8.1.190.0040.00417.78
8.1.180.0030.00618.10
8.1.170.0060.00318.93
8.1.160.0070.00022.33
8.1.150.0040.00418.85
8.1.140.0050.00317.84
8.1.130.0000.00718.20
8.1.120.0080.00017.72
8.1.110.0000.00717.81
8.1.100.0040.00417.80
8.1.90.0040.00417.80
8.1.80.0040.00417.71
8.1.70.0000.00717.73
8.1.60.0060.00317.81
8.1.50.0030.00617.84
8.1.40.0040.00417.92
8.1.30.0040.00417.93
8.1.20.0040.00417.98
8.1.10.0060.00317.75
8.1.00.0000.00817.75
8.0.300.0070.00018.77
8.0.290.0040.00417.30
8.0.280.0050.00318.74
8.0.270.0040.00417.51
8.0.260.0000.00817.49
8.0.250.0070.00017.37
8.0.240.0070.00317.43
8.0.230.0050.00317.35
8.0.220.0030.00317.23
8.0.210.0030.00317.16
8.0.200.0000.00617.29
8.0.190.0040.00417.31
8.0.180.0070.00017.31
8.0.170.0000.00817.37
8.0.160.0070.00017.18
8.0.150.0060.00317.16
8.0.140.0000.00717.14
8.0.130.0030.00313.70
8.0.120.0040.00417.22
8.0.110.0040.00417.26
8.0.100.0040.00417.26
8.0.90.0040.00417.21
8.0.80.0090.00617.06
8.0.70.0030.00517.23
8.0.60.0040.00417.23
8.0.50.0040.00417.35
8.0.30.0080.01117.45
8.0.20.0060.01417.53
8.0.10.0000.00817.46
8.0.00.0130.00816.92
7.4.330.0050.00015.00
7.4.320.0030.00316.84
7.4.300.0030.00316.92
7.4.290.0000.00716.89
7.4.280.0040.00416.89
7.4.270.0040.00416.93
7.4.260.0030.00313.54
7.4.250.0040.00416.80
7.4.240.0020.00516.89
7.4.230.0000.00716.68
7.4.220.0090.00916.80
7.4.210.0100.00716.76
7.4.200.0000.00816.95
7.4.190.0040.00416.93
7.4.160.0130.00516.73
7.4.150.0030.01617.40
7.4.140.0090.00917.86
7.4.130.0150.00516.79
7.4.120.0070.01116.73
7.4.110.0090.01316.63
7.4.100.0060.01616.86
7.4.90.0130.00816.73
7.4.80.0130.01219.39
7.4.70.0070.01216.92
7.4.60.0070.01016.73
7.4.50.0030.00616.68
7.4.40.0070.01322.77
7.4.30.0060.01116.64
7.4.10.0030.01415.34
7.4.00.0070.01215.12
7.3.330.0060.00013.52
7.3.320.0030.00313.75
7.3.310.0000.00716.62
7.3.300.0000.00716.73
7.3.290.0060.00916.66
7.3.280.0110.00916.66
7.3.270.0110.01117.40
7.3.260.0130.00616.80
7.3.250.0130.00916.86
7.3.240.0140.00716.66
7.3.230.0060.01116.86
7.3.210.0090.00916.71
7.3.200.0110.00819.39
7.3.190.0120.00916.68
7.3.180.0140.00316.57
7.3.170.0120.00316.61
7.3.160.0150.00316.87
7.3.130.0090.01215.21
7.3.120.0050.01315.30
7.3.110.0060.01314.95
7.3.100.0080.00615.10
7.3.90.0060.00914.99
7.3.80.0030.00615.32
7.3.70.0100.00714.97
7.3.60.0000.01415.25
7.3.50.0030.01015.26
7.3.40.0060.00315.25
7.3.30.0070.00714.87
7.3.20.0070.00716.81
7.3.10.0120.00316.92
7.3.00.0030.01417.07
7.2.330.0120.00616.98
7.2.320.0080.01117.08
7.2.310.0100.00716.69
7.2.300.0080.01116.68
7.2.290.0060.01216.75
7.2.260.0070.01015.17
7.2.250.0070.01015.23
7.2.240.0110.00315.51
7.2.230.0090.00615.21
7.2.220.0080.00915.23
7.2.210.0000.01514.88
7.2.200.0000.01615.39
7.2.190.0080.00815.09
7.2.180.0030.01215.37
7.2.170.0030.01215.30
7.2.160.0030.01315.59
7.2.150.0090.00617.44
7.2.140.0100.00716.95
7.2.130.0030.01417.21
7.2.120.0040.01117.41
7.2.110.0060.00616.95
7.2.100.0040.01217.35
7.2.90.0030.00917.27
7.2.80.0070.01017.35
7.2.70.0110.00717.36
7.2.60.0110.00417.08
7.2.50.0130.00317.00
7.2.40.0000.01317.36
7.2.30.0030.01017.18
7.2.20.0030.00917.04
7.2.10.0040.01117.16
7.2.00.0040.00817.32
7.1.330.0080.00416.34
7.1.320.0120.00415.80
7.1.310.0160.00016.30
7.1.300.0040.01115.93
7.1.290.0090.00616.14
7.1.280.0060.00316.03
7.1.270.0060.00615.84
7.1.260.0040.00815.87
7.1.250.0000.00916.12
7.1.240.0070.00715.71
7.1.230.0110.00316.14
7.1.220.0000.01316.15
7.1.210.0030.00615.91
7.1.200.0120.00315.80
7.1.190.0080.00415.75
7.1.180.0120.00316.02
7.1.170.0040.00815.86
7.1.160.0090.00316.15
7.1.150.0030.01015.96
7.1.140.0030.01116.18
7.1.130.0080.00716.05
7.1.120.0080.00415.73
7.1.110.0130.00016.06
7.1.100.0090.00615.93
7.1.90.0070.00715.99
7.1.80.0060.00916.22
7.1.70.0060.00616.97
7.1.60.0070.00717.77
7.1.50.0030.01616.65
7.1.40.0070.00716.10
7.1.30.0040.01116.18
7.1.20.0040.01116.04
7.1.10.0120.00316.10
7.1.00.0070.03919.45
7.0.330.0100.00315.45
7.0.320.0070.00715.92
7.0.310.0040.00715.46
7.0.300.0060.01015.80
7.0.290.0030.00515.47
7.0.280.0080.00615.68
7.0.270.0060.00315.62
7.0.260.0000.01015.70
7.0.250.0070.00415.83
7.0.240.0070.00315.50
7.0.230.0060.00615.81
7.0.220.0000.01015.38
7.0.210.0030.00615.65
7.0.200.0010.01016.30
7.0.190.0080.00815.58
7.0.180.0090.00015.73
7.0.170.0030.01015.80
7.0.160.0090.00615.34
7.0.150.0060.00615.43
7.0.140.0020.04419.02
7.0.130.0080.00815.82
7.0.120.0000.00915.41
7.0.110.0030.00915.86
7.0.100.0110.00415.84
7.0.90.0140.00315.42
7.0.80.0090.00315.84
7.0.70.0030.00715.43
7.0.60.0110.04018.83
7.0.50.0030.03816.86
7.0.40.0040.04717.04
7.0.30.0210.02317.17
7.0.20.0130.02217.09
7.0.10.0080.03917.09
7.0.00.0100.04417.13
5.6.400.0060.00914.58
5.6.390.0040.00814.63
5.6.380.0100.00714.66
5.6.370.0040.01114.53
5.6.360.0140.00015.07
5.6.350.0040.00714.71
5.6.340.0090.00314.67
5.6.330.0000.00914.80
5.6.320.0000.01214.71
5.6.310.0000.01114.45
5.6.300.0090.00614.57
5.6.290.0000.01514.64
5.6.280.0030.04118.04
5.6.270.0060.00915.06
5.6.260.0000.01314.91
5.6.250.0060.00914.95
5.6.240.0000.01714.43
5.6.230.0000.01315.00
5.6.220.0080.00814.87
5.6.210.0050.02417.68
5.6.200.0050.04716.60
5.6.190.0070.04517.83
5.6.180.0150.04217.73
5.6.170.0180.02317.79
5.6.160.0070.02917.70
5.6.150.0030.02716.65
5.6.140.0070.02216.60
5.6.130.0040.03116.53
5.6.120.0040.03917.98
5.6.110.0150.03617.91
5.6.100.0150.04018.02
5.6.90.0100.04817.88
5.6.80.0150.03817.77
5.6.70.0040.01214.57
5.6.60.0060.00614.72
5.6.50.0080.00414.74
5.6.40.0030.01414.62
5.6.30.0040.00414.71
5.6.20.0040.01214.66
5.6.10.0070.00714.45
5.6.00.0080.00814.83
5.5.380.0070.00714.86
5.5.370.0040.01114.41
5.5.360.0000.01414.57
5.5.350.0070.03117.46
5.5.340.0050.03916.51
5.5.330.0120.03217.65
5.5.320.0320.03817.80
5.5.310.0160.04317.51
5.5.300.0060.03416.56
5.5.290.0030.04816.29
5.5.280.0100.04317.77
5.5.270.0130.03717.96
5.5.260.0100.04417.89
5.5.250.0030.02517.85
5.5.240.0290.03017.62
5.5.230.0030.01014.59
5.5.220.0060.00914.77
5.5.210.0030.01014.73
5.5.200.0100.00614.80
5.5.190.0120.00014.39
5.5.180.0070.01014.79
5.5.170.0000.01114.79
5.5.160.0100.00714.70
5.5.150.0080.00414.77
5.5.140.0030.00914.48
5.5.130.0030.00714.50
5.5.120.0120.00414.75
5.5.110.0070.00714.68
5.5.100.0060.00314.61
5.5.90.0040.01114.58
5.5.80.0030.01014.30
5.5.70.0030.00914.50
5.5.60.0080.00514.50
5.5.50.0040.01114.79
5.5.40.0060.00314.64
5.5.30.0050.00514.47
5.5.20.0040.01114.79
5.5.10.0070.00314.52
5.5.00.0110.00314.19
5.4.450.0170.04016.54
5.4.440.0170.02316.56
5.4.430.0180.02916.57
5.4.420.0180.02516.50
5.4.410.0180.01816.48
5.4.400.0180.01916.31
5.4.390.0170.02316.42
5.4.380.0130.02816.18
5.4.370.0230.03516.26
5.4.360.0230.03516.42
5.4.350.0170.02016.35
5.4.340.0160.02316.21
5.4.330.0040.00713.43
5.4.320.0140.02516.20
5.4.310.0180.02916.35
5.4.300.0260.03516.40
5.4.290.0190.02216.42
5.4.280.0220.02216.38
5.4.270.0200.02616.27
5.4.260.0150.02516.42
5.4.250.0250.03416.21
5.4.240.0170.03216.21
5.4.230.0260.01816.46
5.4.220.0170.04216.25
5.4.210.0200.02716.41
5.4.200.0190.02316.39
5.4.190.0190.01916.37
5.4.180.0150.02316.30
5.4.170.0150.02616.26
5.4.160.0150.02916.34
5.4.150.0200.03416.33
5.4.140.0170.01815.06
5.4.130.0150.02114.97
5.4.120.0150.02314.96
5.4.110.0260.03214.99
5.4.100.0180.02315.04
5.4.90.0160.03915.04
5.4.80.0250.03115.01
5.4.70.0200.02514.94
5.4.60.0260.03315.11
5.4.50.0150.03715.05
5.4.40.0190.02015.00
5.4.30.0210.01815.10
5.4.20.0280.03115.02
5.4.10.0240.03314.93
5.4.00.0230.03614.89
5.3.290.0170.02414.22
5.3.280.0200.04014.10
5.3.270.0220.01614.11
5.3.260.0180.02014.08
5.3.250.0170.02414.07
5.3.240.0220.01514.21
5.3.230.0190.01914.07
5.3.220.0200.03214.08
5.3.210.0250.03514.18
5.3.200.0170.03214.16
5.3.190.0170.02814.06
5.3.180.0220.03014.08
5.3.170.0290.03314.09
5.3.160.0220.03514.09
5.3.150.0170.03514.18
5.3.140.0260.03314.09
5.3.130.0170.02814.13
5.3.120.0210.04014.09
5.3.110.0280.03514.04
5.3.100.0200.02113.91
5.3.90.0180.02113.81
5.3.80.0220.02013.90
5.3.70.0170.02113.79
5.3.60.0200.03113.78
5.3.50.0220.03013.87
5.3.40.0140.02513.74
5.3.30.0170.02513.85
5.3.20.0250.01713.62
5.3.10.0160.02813.64
5.3.00.0130.02313.61
5.2.170.0200.03711.51
5.2.160.0170.03711.43
5.2.150.0270.03311.25
5.2.140.0230.03011.43
5.2.130.0400.02311.23
5.2.120.0300.03311.17
5.2.110.0230.03011.29
5.2.100.0230.03011.43
5.2.90.0300.02311.22
5.2.80.0430.05011.21
5.2.70.0370.05311.29
5.2.60.0330.04711.41
5.2.50.0400.05311.12
5.2.40.0200.04011.11
5.2.30.0200.03311.26
5.2.20.0230.03011.06
5.2.10.0230.03710.98
5.2.00.0200.02711.08
5.1.60.0230.02010.18
5.1.50.0230.02710.18
5.1.40.0200.02310.18
5.1.30.0200.02710.70
5.1.20.0200.02710.63
5.1.10.0170.02710.44
5.1.00.0200.02310.34
5.0.50.0100.02310.00
5.0.40.0100.02010.00
5.0.30.0130.02710.00
5.0.20.0100.02010.00
5.0.10.0170.02010.00
5.0.00.0130.02710.00
4.4.90.0070.01710.00
4.4.80.0130.02010.00
4.4.70.0170.03010.00
4.4.60.0130.03010.00
4.4.50.0100.03010.00
4.4.40.0070.02710.00
4.4.30.0130.01310.00
4.4.20.0100.01310.00
4.4.10.0130.01310.00
4.4.00.0200.02010.00
4.3.110.0070.01710.00
4.3.100.0070.01710.00
4.3.90.0070.01710.00
4.3.80.0100.02710.00
4.3.70.0170.01310.00
4.3.60.0070.01710.00
4.3.50.0100.01710.00
4.3.40.0130.02310.00
4.3.30.0070.01310.00
4.3.20.0030.01710.00
4.3.10.0070.01310.00
4.3.00.0070.01310.00

preferences:
75.34 ms | 400 KiB | 5 Q