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.0070.00716.75
8.3.50.0170.00319.96
8.3.40.0150.00618.88
8.3.30.0000.01519.04
8.3.20.0040.00420.29
8.3.10.0080.00023.52
8.3.00.0050.00319.38
8.2.180.0110.00716.63
8.2.170.0090.00922.96
8.2.160.0070.01120.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0050.00320.97
8.2.110.0060.00320.43
8.2.100.0080.00318.03
8.2.90.0130.00018.72
8.2.80.0000.00917.97
8.2.70.0030.00617.63
8.2.60.0050.00317.93
8.2.50.0030.00818.07
8.2.40.0030.00518.16
8.2.30.0050.00318.01
8.2.20.0050.00317.70
8.2.10.0000.00818.03
8.2.00.0000.01117.80
8.1.280.0090.00625.92
8.1.270.0050.00323.91
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00624.05
8.1.230.0040.00819.14
8.1.220.0050.00317.91
8.1.210.0000.00818.77
8.1.200.0130.00017.48
8.1.190.0040.00417.46
8.1.180.0050.00318.10
8.1.170.0030.00618.62
8.1.160.0040.00422.06
8.1.150.0040.00419.06
8.1.140.0000.00717.57
8.1.130.0030.00317.89
8.1.120.0040.00417.55
8.1.110.0040.00417.40
8.1.100.0000.00717.50
8.1.90.0000.00817.59
8.1.80.0030.00717.51
8.1.70.0000.00717.51
8.1.60.0030.00517.61
8.1.50.0080.00017.63
8.1.40.0000.00917.60
8.1.30.0030.00517.73
8.1.20.0030.00617.61
8.1.10.0030.00517.70
8.1.00.0040.00417.63
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.42
8.0.270.0000.00717.34
8.0.260.0000.00817.33
8.0.250.0000.00717.06
8.0.240.0000.00717.02
8.0.230.0000.00716.96
8.0.220.0000.00717.04
8.0.210.0030.00317.05
8.0.200.0060.00017.09
8.0.190.0030.00317.08
8.0.180.0040.00417.04
8.0.170.0040.00417.02
8.0.160.0040.00416.91
8.0.150.0040.00416.99
8.0.140.0080.00016.89
8.0.130.0050.00213.39
8.0.120.0040.00416.88
8.0.110.0000.00716.98
8.0.100.0050.00316.88
8.0.90.0040.00416.83
8.0.80.0150.00617.07
8.0.70.0030.00617.02
8.0.60.0040.00417.07
8.0.50.0040.00416.90
8.0.30.0110.01017.05
8.0.20.0110.00917.40
8.0.10.0040.00417.06
8.0.00.0100.00816.95
7.4.330.0020.00215.15
7.4.320.0030.00316.60
7.4.300.0060.00016.59
7.4.290.0040.00416.60
7.4.280.0030.00616.71
7.4.270.0070.00016.65
7.4.260.0030.00316.46
7.4.250.0000.00716.63
7.4.240.0050.00316.59
7.4.230.0040.00416.76
7.4.220.0070.01316.70
7.4.210.0100.00716.62
7.4.200.0040.00416.52
7.4.160.0120.01216.74
7.4.150.0090.00917.40
7.4.140.0080.01217.86
7.4.130.0090.00816.70
7.4.120.0070.01116.58
7.4.110.0140.01016.65
7.4.100.0090.00916.57
7.4.90.0030.01416.48
7.4.80.0130.00619.39
7.4.70.0120.00416.55
7.4.60.0190.00016.80
7.4.50.0030.00516.50
7.4.40.0000.01616.83
7.4.30.0040.01216.44
7.4.00.0070.00715.11
7.3.330.0000.00513.40
7.3.320.0000.00513.38
7.3.310.0070.00016.48
7.3.300.0030.00316.48
7.3.290.0080.00816.46
7.3.280.0120.00716.42
7.3.270.0060.01217.40
7.3.260.0150.00816.43
7.3.250.0070.01116.58
7.3.240.0030.01316.37
7.3.230.0140.00316.63
7.3.210.0080.00816.64
7.3.200.0030.01319.39
7.3.190.0100.00716.54
7.3.180.0160.00616.46
7.3.170.0030.01316.66
7.3.160.0090.00916.41
7.2.330.0130.01416.48
7.2.320.0120.00416.68
7.2.310.0070.01716.41
7.2.300.0040.01216.47
7.2.290.0030.01316.67
7.2.60.0060.00916.84
7.2.00.0040.00819.39
7.1.200.0040.00715.65
7.1.100.0080.00318.17
7.1.70.0000.01217.20
7.1.60.0100.01419.46
7.1.50.0030.01016.98
7.1.00.0030.07322.36
7.0.200.0050.00316.48
7.0.140.0070.07022.08
7.0.60.0130.04019.98
7.0.50.0070.08317.93
7.0.40.0200.06320.21
7.0.30.0270.08020.08
7.0.20.0330.06720.21
7.0.10.0070.04020.07
7.0.00.0070.08320.11
5.6.280.0070.07320.80
5.6.210.0130.06020.77
5.6.200.0070.03718.29
5.6.190.0030.04320.54
5.6.180.0330.04020.39
5.6.170.0230.04720.55
5.6.160.0030.05320.46
5.6.150.0030.05018.18
5.6.140.0130.07018.21
5.6.130.0070.05318.21
5.6.120.0130.05021.14
5.6.110.0070.03720.99
5.6.100.0100.08721.06
5.6.90.0000.07320.99
5.6.80.0070.08320.39
5.5.350.0270.07720.54
5.5.340.0000.08718.07
5.5.330.0100.08320.40
5.5.320.0070.08020.35
5.5.310.0200.06020.34
5.5.300.0070.08018.05
5.5.290.0030.08317.98
5.5.280.0100.04720.87
5.5.270.0100.08320.79
5.5.260.0030.05320.81
5.5.250.0100.06020.82
5.5.240.0070.07320.37
5.4.450.0830.06319.61
5.4.440.0630.07019.69
5.4.430.0900.04319.45
5.4.420.0830.05719.60
5.4.410.0570.06019.48
5.4.400.0970.04719.26
5.4.390.0100.05719.29
5.4.380.0430.05318.63
5.4.370.0330.06318.78
5.4.360.0470.05718.62
5.4.350.0470.05318.79
5.4.340.0370.05318.54
5.4.320.0050.03912.52
5.4.310.0070.03712.52
5.4.300.0040.03812.52
5.4.290.0040.04012.52
5.4.280.0010.03912.41
5.4.270.0070.04412.42
5.4.260.0100.03312.42
5.4.250.0090.03812.42
5.4.240.0030.03812.41
5.4.230.0020.04112.41
5.4.220.0060.03512.41
5.4.210.0060.03412.41
5.4.200.0050.03812.41
5.4.190.0050.04012.41
5.4.180.0030.04012.41
5.4.170.0070.04112.41
5.4.160.0040.03612.42
5.4.150.0040.03712.41
5.4.140.0030.03912.09
5.4.130.0030.03812.08
5.4.120.0070.03312.04
5.4.110.0070.03312.04
5.4.100.0070.03412.04
5.4.90.0050.04512.04
5.4.80.0040.04012.03
5.4.70.0040.03612.03
5.4.60.0060.03912.03
5.4.50.0040.03812.03
5.4.40.0050.03512.02
5.4.30.0070.03512.02
5.4.20.0070.03312.02
5.4.10.0040.03612.02
5.4.00.0050.03611.51
5.3.290.0050.04112.80
5.3.280.0070.04412.71
5.3.270.0070.03812.72
5.3.260.0060.03912.72
5.3.250.0020.04412.72
5.3.240.0070.03712.72
5.3.230.0060.03812.71
5.3.220.0070.03612.68
5.3.210.0080.03712.69
5.3.200.0070.03912.68
5.3.190.0020.04312.68
5.3.180.0060.03812.68
5.3.170.0110.03212.68
5.3.160.0060.03712.68
5.3.150.0050.03812.68
5.3.140.0070.04212.68
5.3.130.0070.04012.67
5.3.120.0040.04112.66
5.3.110.0070.03812.67
5.3.100.0040.03812.16
5.3.90.0060.04212.13
5.3.80.0070.03412.13
5.3.70.0050.03712.12
5.3.60.0020.04112.11
5.3.50.0050.03612.05
5.3.40.0040.03712.05
5.3.30.0090.03212.02
5.3.20.0110.03511.79
5.3.10.0060.03911.76
5.3.00.0060.03611.75
5.2.170.0070.0399.25
5.2.160.0030.0319.26
5.2.150.0070.0299.26
5.2.140.0030.0319.25
5.2.130.0050.0289.21
5.2.120.0050.0279.21
5.2.110.0040.0309.21
5.2.100.0070.0289.21
5.2.90.0050.0289.22
5.2.80.0050.0349.21
5.2.70.0050.0309.21
5.2.60.0060.0289.16
5.2.50.0050.0299.13
5.2.40.0040.0299.11
5.2.30.0030.0309.09
5.2.20.0050.0289.07
5.2.10.0100.0258.98
5.2.00.0090.0268.84
5.1.60.0070.0368.13
5.1.50.0010.0268.13
5.1.40.0050.0238.10
5.1.30.0030.0268.45
5.1.20.0050.0268.48
5.1.10.0040.0268.21
5.1.00.0040.0258.21
5.0.50.0060.0186.73
5.0.40.0040.0186.58
5.0.30.0040.0306.39
5.0.20.0030.0196.38
5.0.10.0060.0176.36
5.0.00.0030.0306.35
4.4.90.0040.0144.77
4.4.80.0040.0144.76
4.4.70.0020.0164.75
4.4.60.0010.0174.75
4.4.50.0010.0174.77
4.4.40.0020.0264.72
4.4.30.0030.0154.75
4.4.20.0010.0174.84
4.4.10.0010.0174.85
4.4.00.0030.0254.76
4.3.110.0010.0184.67
4.3.100.0010.0174.66
4.3.90.0020.0154.65
4.3.80.0010.0264.65
4.3.70.0020.0214.64
4.3.60.0020.0154.65
4.3.50.0040.0144.65
4.3.40.0040.0264.60
4.3.30.0030.0153.41
4.3.20.0000.0183.39
4.3.10.0020.0163.35
4.3.00.0100.0237.86

preferences:
54.59 ms | 400 KiB | 5 Q