3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DrawConnector { var $x0, $y0; var $R1; var $recx, $recy; //var $img; function __construct($img, $x0, $y0, $R1, $recx, $recy) { //$this -> img = $img; $this -> x0 = $x0; $this -> y0 = $y0; $this -> R1 = $R1; $this -> recx = $recx; $this -> recy = $recy; } function __draw($alpha1, $alpha2, $color) { $img = @ImageCreate (400, 400); $color = ImageColorAllocate ($img, 233, 0, 0); $blue = imagecolorallocate($img, 0, 0, 255); $alpha_delta = $alpha2 - $alpha1; $x1_0 = sin($alpha1) * $this -> R1; $y1_0 = cos($alpha1) * $this -> R1; $x2_0 = sin($alpha2) * $this -> R1; $y2_0 = cos($alpha2) * $this -> R1; $l = sqrt(($x2_0 - $x1_0) ^ 2 + ($y2_0 -$y1_0) ^ 2); If ($alpha_delta == pi()) { imageline($img, ($this -> x0 + ('1' - $this -> recx / $this -> R1 * '1.2') * $x1_0), ($this -> y0 + ('1' - $this -> recx / $this -> R1 * '1.2') * $y1_0), ($this -> x0 + ('1' - $this -> recx / $this -> R1 * '1.2') * $x2_0), ($this -> y0 + ('1' - $this -> recx / $this -> R1 * '1.2') * $y2_0), $color); } Else { $beta = ($alpha1 + $alpha2) / 2; $R1_kurz = $this -> R1 - $this -> recx * 1.2; $cx = sin($alpha1 + ($alpha2 - $alpha1) / 2) * $R1_kurz / cos(($alpha2 - $alpha1) / 2) + $this -> x0; $cy = cos($alpha1 + ($alpha2 - $alpha1) / 2) * $R1_kurz / cos(($alpha2 - $alpha1) / 2) + $this -> y0; $R2 = tan(($alpha2 - $alpha1) / 2) * $this -> R1; $R2_kurz = tan(($alpha2 - $alpha1) / 2) * $R1_kurz; $gamma = asin(($l / 2) / $R2); imagearc($img, '100', '100', '50', '50', '20', '60', $color); $cxx=$cx - $R2_kurz; $cyy=$cy - $R2_kurz; $R2_arc=$R2_kurz * '2'; $alpha_start=(-$gamma - $beta) / pi() * 180 - 90; $alpha_ende=($gamma - $beta) / pi() * 180; echo $cxx; echo $cyy; echo $R2; echo $alpha_start; echo $alpha_ende; //imagearc($img, $cxx, $cyy, $R2_arc, $R2_arc, $alpha_start, $alpha_ende, $color); header( "Content-type: image/png" ); imagepng($img); imagedestroy($img); } return null; } } $img = @ImageCreate (400, 400); $color = ImageColorAllocate ($img, 233, 0, 0); $blue = imagecolorallocate($img, 0, 0, 255); imagearc($img, '100', '100', '50', '50', '20', '60', $blue); //$DrawCon = new DrawConnector($img,'200','200','100','20','20'); //$DrawCon -> __draw($img, '0.1','0.2',$blue); header( "Content-type: image/png" ); imagepng($img); imagedestroy($img); ?>

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.60.0150.00616.73
8.3.50.0120.00722.77
8.3.40.0150.00618.88
8.3.30.0100.00319.06
8.3.20.0040.00420.38
8.3.10.0000.00823.51
8.3.00.0030.00519.38
8.2.180.0030.01416.75
8.2.170.0140.00722.96
8.2.160.0070.01020.46
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00421.09
8.2.110.0060.00320.66
8.2.100.0040.00818.28
8.2.90.0050.00518.95
8.2.80.0000.00817.97
8.2.70.0060.00317.75
8.2.60.0040.00418.05
8.2.50.0000.01018.07
8.2.40.0080.00018.34
8.2.30.0000.00718.14
8.2.20.0060.00317.85
8.2.10.0040.00418.06
8.2.00.0000.00817.84
8.1.280.0120.00325.92
8.1.270.0060.00324.00
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00022.08
8.1.230.0090.00319.17
8.1.220.0000.00817.88
8.1.210.0030.00518.77
8.1.200.0070.00417.38
8.1.190.0070.00317.23
8.1.180.0090.00019.14
8.1.170.0000.00918.77
8.1.160.0020.00522.02
8.1.150.0030.00518.92
8.1.140.0050.00217.35
8.1.130.0080.00017.86
8.1.120.0040.00417.49
8.1.110.0000.00817.41
8.1.100.0040.00417.44
8.1.90.0030.00417.38
8.1.80.0050.00417.49
8.1.70.0070.00017.43
8.1.60.0040.00417.54
8.1.50.0040.00417.56
8.1.40.0090.00017.53
8.1.30.0000.00917.49
8.1.20.0050.00317.75
8.1.10.0080.00017.61
8.1.00.0030.00517.49
8.0.300.0050.00318.77
8.0.290.0060.00316.88
8.0.280.0000.00718.55
8.0.270.0040.00417.30
8.0.260.0040.00417.36
8.0.250.0030.00317.21
8.0.240.0040.00417.00
8.0.230.0000.00717.13
8.0.220.0000.00716.92
8.0.210.0040.00417.07
8.0.200.0030.00317.10
8.0.190.0000.00917.14
8.0.180.0070.00016.98
8.0.170.0000.00817.04
8.0.160.0000.00717.10
8.0.150.0030.00516.96
8.0.140.0000.00717.05
8.0.130.0000.00713.52
8.0.120.0000.00816.95
8.0.110.0020.00517.02
8.0.100.0000.00716.99
8.0.90.0000.00816.95
8.0.80.0130.00316.99
8.0.70.0040.00417.08
8.0.60.0000.00717.06
8.0.50.0040.00416.93
8.0.30.0110.00817.09
8.0.20.0070.01317.40
8.0.10.0050.00216.98
8.0.00.0140.00316.77
7.4.330.0000.00615.09
7.4.320.0030.00316.53
7.4.300.0000.00616.63
7.4.290.0050.00316.59
7.4.280.0000.00716.52
7.4.270.0070.00016.61
7.4.260.0070.00416.51
7.4.250.0030.00516.60
7.4.240.0040.00416.63
7.4.230.0000.00716.67
7.4.220.0180.00516.66
7.4.210.0180.00316.55
7.4.200.0040.00416.43
7.4.160.0100.00716.70
7.4.150.0160.00917.40
7.4.140.0090.00817.86
7.4.130.0080.00916.55
7.4.120.0100.00816.71
7.4.110.0100.00616.52
7.4.100.0120.00616.41
7.4.90.0080.00916.49
7.4.80.0140.00919.39
7.4.70.0070.01016.64
7.4.60.0080.00816.63
7.4.50.0000.00816.70
7.4.40.0120.00616.39
7.4.30.0060.01316.52
7.4.00.0040.01415.11
7.3.330.0000.00613.24
7.3.320.0030.00313.19
7.3.310.0000.00716.24
7.3.300.0000.00716.39
7.3.290.0140.00616.39
7.3.280.0060.01016.34
7.3.270.0080.00817.40
7.3.260.0140.00316.62
7.3.250.0090.00716.43
7.3.240.0100.00616.44
7.3.230.0160.00016.59
7.3.210.0130.00316.38
7.3.200.0080.00819.39
7.3.190.0040.01416.52
7.3.180.0130.00316.37
7.3.170.0060.01016.60
7.3.160.0070.01016.38
7.3.10.0080.00816.32
7.3.00.0050.00516.61
7.2.330.0060.01216.54
7.2.320.0060.01016.77
7.2.310.0170.00316.60
7.2.300.0080.00816.57
7.2.290.0080.00816.27
7.2.130.0060.00916.74
7.2.120.0070.00316.76
7.2.110.0060.00616.70
7.2.100.0030.00716.82
7.2.90.0090.00416.70
7.2.80.0030.01116.50
7.2.70.0070.00716.78
7.2.60.0030.00916.58
7.2.50.0050.00816.85
7.2.40.0140.00316.47
7.2.30.0070.00716.89
7.2.20.0030.01016.75
7.2.10.0090.00316.53
7.2.00.0060.00818.02
7.1.250.0000.01515.45
7.1.200.0040.00715.66
7.1.100.0060.00318.07
7.1.70.0050.00316.97
7.1.60.0070.01719.46
7.1.50.0000.01716.57
7.1.00.0030.07722.30
7.0.200.0030.00616.68
7.0.140.0000.07721.95
7.0.60.0070.08719.88
7.0.50.0030.07718.00
7.0.40.0070.07020.02
7.0.30.0570.06020.24
7.0.20.0230.04720.09
7.0.10.0200.03720.26
7.0.00.0030.04020.19
5.6.280.0000.07720.88
5.6.210.0070.05020.79
5.6.200.0030.06318.16
5.6.190.0100.06720.77
5.6.180.0130.04720.63
5.6.170.0330.07320.50
5.6.160.0130.07720.54
5.6.150.0070.03718.24
5.6.140.0070.07718.15
5.6.130.0130.05018.16
5.6.120.0000.05021.16
5.6.110.0000.10021.03
5.6.100.0030.04321.13
5.6.90.0070.08320.96
5.6.80.0030.04320.31
5.6.70.3630.04320.30
5.5.350.0030.06720.42
5.5.340.0030.04717.98
5.5.330.0000.04320.28
5.5.320.0330.04320.34
5.5.310.0300.07020.32
5.5.300.0130.07717.95
5.5.290.0070.03718.07
5.5.280.0030.07020.82
5.5.270.0070.05720.86
5.5.260.0030.05320.74
5.5.250.0000.07720.71
5.5.240.0270.06720.17
5.4.450.0230.04019.39
5.4.440.0300.04019.46
5.4.430.0270.04019.30
5.4.420.0300.04019.19
5.4.410.0270.04019.44
5.4.400.0300.04318.97
5.4.390.0430.04019.20
5.4.380.0400.04718.54
5.4.370.0430.05718.71
5.4.360.0370.06718.79
5.4.350.0400.05718.78
5.4.340.0430.05318.48
5.4.320.0050.03912.53
5.4.310.0070.03812.52
5.4.300.0050.03812.52
5.4.290.0060.04312.52
5.4.280.0080.03312.42
5.4.270.0030.04012.42
5.4.260.0060.04312.42
5.4.250.0050.03812.42
5.4.240.0060.03612.42
5.4.230.0060.03912.41
5.4.220.0080.05012.41
5.4.210.0060.03412.41
5.4.200.0060.03712.41
5.4.190.0040.03712.41
5.4.180.0040.03912.41
5.4.170.0060.03512.41
5.4.160.0090.03612.42
5.4.150.0070.03912.41
5.4.140.0030.03812.09
5.4.130.0080.03312.08
5.4.120.0050.03512.04
5.4.110.0050.03512.04
5.4.100.0060.03612.04
5.4.90.0100.03812.03
5.4.80.0040.03812.04
5.4.70.0090.03112.04
5.4.60.0050.03512.04
5.4.50.0070.03312.03
5.4.40.0080.03912.02
5.4.30.0070.03412.02
5.4.20.0080.03212.02
5.4.10.0080.03212.02
5.4.00.0060.03511.51
5.3.290.0070.03812.80
5.3.280.0050.03912.71
5.3.270.0050.04012.72
5.3.260.0070.04112.72
5.3.250.0030.03912.72
5.3.240.0040.03912.72
5.3.230.0050.04112.71
5.3.220.0080.03912.68
5.3.210.0020.04212.68
5.3.200.0050.03612.68
5.3.190.0070.03512.68
5.3.180.0030.03812.68
5.3.170.0060.03512.68
5.3.160.0080.03312.68
5.3.150.0050.03712.68
5.3.140.0080.03512.68
5.3.130.0050.03912.67
5.3.120.0060.03812.66
5.3.110.0080.03712.66
5.3.100.0030.04012.15
5.3.90.0050.03712.14
5.3.80.0030.04412.12
5.3.70.0040.03712.13
5.3.60.0040.03912.11
5.3.50.0040.03812.06
5.3.40.0060.03512.05
5.3.30.0070.03512.02
5.3.20.0040.03711.80
5.3.10.0060.03311.76
5.3.00.0050.03611.75
5.2.170.0050.0299.25
5.2.160.0050.0289.25
5.2.150.0030.0329.25
5.2.140.0070.0279.25
5.2.130.0010.0319.21
5.2.120.0020.0309.21
5.2.110.0030.0299.22
5.2.100.0030.0379.22
5.2.90.0040.0299.21
5.2.80.0020.0339.21
5.2.70.0040.0319.21
5.2.60.0040.0339.16
5.2.50.0070.0279.13
5.2.40.0060.0279.11
5.2.30.0040.0309.09
5.2.20.0030.0309.07
5.2.10.0050.0278.98
5.2.00.0050.0288.84
5.1.60.0050.0268.13
5.1.50.0050.0238.12
5.1.40.0070.0238.11
5.1.30.0060.0248.45
5.1.20.0040.0268.48
5.1.10.0010.0288.20
5.1.00.0010.0298.20
5.0.50.0030.0216.72
5.0.40.0040.0266.58
5.0.30.0030.0316.39
5.0.20.0030.0206.38
5.0.10.0000.0246.36
5.0.00.0040.0316.35
4.4.90.0030.0154.78
4.4.80.0000.0194.75
4.4.70.0030.0214.75
4.4.60.0020.0164.76
4.4.50.0040.0134.77
4.4.40.0030.0254.71
4.4.30.0030.0154.76
4.4.20.0060.0134.84
4.4.10.0040.0164.85
4.4.00.0030.0284.76
4.3.110.0020.0174.66
4.3.100.0030.0184.66
4.3.90.0030.0144.65
4.3.80.0030.0244.64
4.3.70.0020.0174.64
4.3.60.0050.0144.64
4.3.50.0020.0164.64
4.3.40.0040.0234.60
4.3.30.0020.0163.41
4.3.20.0040.0143.39
4.3.10.0010.0173.34
4.3.00.0100.01318.55

preferences:
44.35 ms | 401 KiB | 5 Q