3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Не для слабонервных. Давно бросил пхп, но иногда балуюсь. Данный код - сырое превью. Новичкам - лучше вообще не смотреть. */ $Width=500; $Height=300; $img = imageCreate($Width,$Height); $r = rand(5,200);$g = rand(5,200);$b = rand(5,200); $c = imageColorAllocate($img, 255,255,255); imagefilledrectangle($img, 0, 0, $Width, $Height, $c); //-------------------го дотан------------------------// $w = rand(100,150); $h = rand(100,100); $zsize=rand(20,50); $max = rand(2,7)/10; $max2= 0.5; $zxr = rand(-$w/5,$w/5); $zyr = rand(-$h/5,$h/5); $zform = rand(3,8)/10; $mejg = rand($w/2,$w); $zc = imageColorAllocate($img,rand(5,150),rand(5,150),rand(5,150)); $ec = imageColorAllocate($img,$r,$g,$b); $ebc = imageColorAllocate($img,rand(235,255),rand(235,255),rand(230,255)); $eform = rand(90,100)/100; $eform2 = rand(70,100)/100; $rznglaz = rand(80,120)/100; $rznglaz2 = rand(80,120)/100; $smeshx = (500 - ($w*2+$mejg))/2; DrawEye($img, $smeshx+0,0, $w*$rznglaz,$h ,$ec, $ebc, $eform, $eform2, $zxr, $zyr, $zc, $max, $max2, $zform, $zsize); if(rand(0,5)==0) $zc = imageColorAllocate($img,rand(5,150),rand(5,150),rand(5,150)); DrawEye($img, $smeshx+$w + $mejg, 0, $w*$rznglaz2, $h, $ec, $ebc, $eform, $eform2, $zxr, $zyr, $zc, 1-$max, $max2, $zform, $zsize); //imageellipse ( $img , 100 , 100 ,100 , 100 , imageColorAllocate($img,45,45,45) ); //imagefilledellipse ( $img , 200 , 200 ,100 , 100 , imageColorAllocate($img,45,45,45) ); //-----------------и пили симфоню уже-----------------------// header('Content-type: image/png'); imagepng($img); imagedestroy($img); //-------------------------------------------------------// function DrawEye($image, $xx, $yy, $w, $h, $ec, $ebc, $eform, $eform2, $zxr,$zyr, $zc, $max, $max2, $zform, $zsize) { /* if($w<$h) $zsize = $w/3; else $zsize = $h/3; */ DrawEyePoligon($image,$xx-5,95-5,$w+10,$h+10, imageColorAllocate($image,5,5,5), 1, $max, $max2, 0); DrawEyePoligon($image,$xx,95,$w,$h, imageColorAllocate($image,5,5,5), 1, $max, $max2, 1); DrawEyePoligon($image,$xx,100,$w,$h*$eform, $ec, 1, $max, $max2, 1); DrawEyePoligon($image,$xx+10,100+$zform*10,$w-20,$h*$eform2, $ebc, 1, $max2,$max2, 1); DrawEyePoligon($image,$xx+10,100+$zform*10,$w-20,$h*$eform2, $ebc, 1, $max2,$max2, 1); imagefilledellipse ( $image, $xx+$w/2+$zxr,140+$zyr, $zsize, $zsize, $zc); imagefilledellipse ( $image, $xx+$w/2+$zxr,140+$zyr, $zsize * $zform, $zsize*(1-$zform), imageColorAllocate($image,5,5,5)); imagefilledellipse ( $image, $xx+$w/2+$zxr+10,140+$zyr-10, $zsize * 0.5, $zsize*0.5, imageColorAllocate($image,255,255,255)); } //-------------------------------------------------------// function DrawEyePoligon($image, $xx, $yy, $width, $height, $color, $quality, $max, $max2, $fill) { $height/=2; if($quality>$width/2) $quality=$width/2; $points = array(); for($i=0; $i<=$width; $i+=$quality) { $x = $i-$width; $y=($x*$x) / (($width)*($width)) * $height; array_push($points, $i*$max, $y); } for($i=0; $i<=$width; $i+=$quality) { $x = $i; $y=($x*$x) / (($width)*($width)) * $height; //$y=(($width*$width)-($x*$x)) / (($width)*($width)) * $height; array_push($points, $i*(1-$max)+($width*$max), $y); } for($i=0; $i<=$width; $i+=$quality) { $x = $i-$width; $y=-($x*$x) / (($width)*($width)) * $height; array_push($points, $i*$max2, 2*$height+$y); } for($i=0; $i<=$width; $i+=$quality) { $x = $i; $y=-($x*$x) / (($width)*($width)) * $height; //$y=(($width*$width)-($x*$x)) / (($width)*($width)) * $height; array_push($points, $i*(1-$max2)+($width*$max2), 2*$height+$y); } DrawPoligon($image, $xx, $yy, $points, $color, $fill); } //-------------------------------------------------------// function DrawPoligon($image, $x, $y, $points, $color, $fill) { for($i=0; $i<count($points); $i+=2) { $points[$i]+=$x; $points[$i+1]+=$y; } if($fill) imagefilledpolygon($image, $points, count($points)/2, $color); else imagepolygon($image, $points, count($points)/2, $color); }

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.10.0060.00614.95
7.4.00.0040.01515.07
7.3.130.0030.01614.73
7.3.120.0110.00815.18
7.3.110.0130.00615.18
7.3.100.0030.01414.88
7.3.90.0070.01014.93
7.3.80.0070.00314.60
7.3.70.0000.01514.98
7.3.60.0060.00614.99
7.3.50.0030.01015.03
7.3.40.0100.00015.03
7.3.30.0040.00414.79
7.3.20.0120.00316.70
7.3.10.0080.00516.38
7.3.00.0040.00716.47
7.2.260.0030.01614.85
7.2.250.0120.00615.14
7.2.240.0090.00614.77
7.2.230.0060.01215.00
7.2.220.0030.01315.19
7.2.210.0000.00915.28
7.2.200.0070.01015.06
7.2.190.0030.01315.11
7.2.180.0100.00015.07
7.2.170.0040.00714.86
7.2.160.0130.00614.88
7.2.150.0040.01216.96
7.2.140.0030.00916.78
7.2.130.0050.00816.78
7.2.120.0100.00316.81
7.2.110.0050.00916.55
7.2.100.0000.01416.58
7.2.90.0030.01216.84
7.2.80.0020.01316.59
7.2.70.0100.00216.80
7.2.60.0080.00516.68
7.2.50.0080.00516.57
7.2.40.0050.00816.80
7.2.30.0090.00416.66
7.2.20.0060.00516.72
7.2.10.0060.00516.78
7.2.00.0050.00717.44
7.1.330.0030.01315.23
7.1.320.0070.01015.73
7.1.310.0040.00715.44
7.1.300.0060.00815.62
7.1.290.0040.01215.61
7.1.280.0090.00615.51
7.1.270.0030.00515.46
7.1.260.0070.00715.40
7.1.250.0090.00415.55
7.1.240.0060.00315.69
7.1.230.0070.00715.56
7.1.220.0110.00315.66
7.1.210.0000.01015.68
7.1.200.0000.01115.42
7.1.190.0070.00715.36
7.1.180.0000.01015.71
7.1.170.0060.00315.31
7.1.160.0090.00915.67
7.1.150.0030.00615.59
7.1.140.0030.01015.51
7.1.130.0100.00315.53
7.1.120.0040.00715.74
7.1.110.0030.01015.68
7.1.100.0030.00915.66
7.1.90.0070.01015.68
7.1.80.0090.00415.75
7.1.70.0050.00816.25
7.1.60.0120.00517.71
7.1.50.0060.00916.07
7.1.40.0110.00615.37
7.1.30.0030.00715.50
7.1.20.0030.00915.60
7.1.10.0040.01115.69
7.1.00.0020.04619.01
7.0.330.0030.01015.00
7.0.320.0030.00615.24
7.0.310.0030.00615.33
7.0.300.0040.00815.42
7.0.290.0110.00315.39
7.0.280.0090.00315.12
7.0.270.0030.01015.22
7.0.260.0070.00715.32
7.0.250.0080.00815.46
7.0.240.0030.01315.00
7.0.230.0030.01315.24
7.0.220.0070.00715.24
7.0.210.0030.01315.39
7.0.200.0050.00715.87
7.0.190.0060.00615.34
7.0.180.0070.00715.35
7.0.170.0040.00815.13
7.0.160.0040.00815.34
7.0.150.0000.01215.46
7.0.140.0030.04018.64
7.0.130.0070.00715.09
7.0.120.0030.00715.24
7.0.110.0060.00815.22
7.0.100.0120.03817.57
7.0.90.0030.05017.55
7.0.80.0070.02217.75
7.0.70.0130.03417.66
7.0.60.0050.03417.58
7.0.50.0120.04517.86
7.0.40.0060.04416.74
7.0.30.0050.03716.65
7.0.20.0020.03016.75
7.0.10.0090.02016.70
7.0.00.0020.04516.69
5.6.400.0060.00314.15
5.6.390.0000.01513.85
5.6.380.0060.00914.52
5.6.370.0090.00914.51
5.6.360.0000.01514.36
5.6.350.0030.01414.52
5.6.340.0040.00814.58
5.6.330.0040.00414.21
5.6.320.0070.00714.32
5.6.310.0070.01014.27
5.6.300.0080.00414.37
5.6.290.0060.00614.39
5.6.280.0020.04217.76
5.6.270.0000.01314.26
5.6.260.0060.00914.18
5.6.250.0030.03617.44
5.6.240.0070.04117.46
5.6.230.0050.04217.45
5.6.220.0020.04517.57
5.6.210.0070.04517.37
5.6.200.0080.04517.78
5.6.190.0090.03517.59
5.6.180.0100.02517.54
5.6.170.0090.02217.50
5.6.160.0050.03817.73
5.6.150.0110.03117.53
5.6.140.0070.05217.76
5.6.130.0070.02317.62
5.6.120.0040.02717.70
5.6.110.0010.02817.64
5.6.100.0090.04717.65
5.6.90.0120.04317.65
5.6.80.0040.02817.43
5.6.70.0070.02117.15
5.6.60.0080.04017.29
5.6.50.0050.04517.43
5.6.40.0070.04517.41
5.6.30.0070.03617.33
5.6.20.0070.04217.27
5.6.10.0040.02417.32
5.6.00.0110.03617.19
5.5.380.0030.02317.32
5.5.370.0080.04117.40
5.5.360.0050.04317.25
5.5.350.0070.03317.18
5.5.340.0090.03517.66
5.5.330.0070.02517.55
5.5.320.0070.04317.42
5.5.310.0030.02317.58
5.5.300.0040.02217.45
5.5.290.0050.02217.60
5.5.280.0070.02317.46
5.5.270.0100.03417.61
5.5.260.0060.03217.62
5.5.250.0100.04317.47
5.5.240.0140.03317.13
5.5.230.0050.02317.21
5.5.220.0090.03117.09
5.5.210.0140.01816.95
5.5.200.0100.03217.22
5.5.190.0070.03817.24
5.5.180.0100.04017.19
5.5.170.0000.01713.94
5.5.160.0030.03517.19
5.5.150.0080.02617.12
5.5.140.0050.04316.88
5.5.130.0020.02717.05
5.5.120.0050.02417.31
5.5.110.0130.03017.09
5.5.100.0130.02717.00
5.5.90.0000.02917.19
5.5.80.0080.02517.13
5.5.70.0030.03617.09
5.5.60.0100.03917.20
5.5.50.0050.02117.05
5.5.40.0020.04217.00
5.5.30.0050.03717.00
5.5.20.0080.01817.19
5.5.10.0030.04917.15
5.5.00.0100.03217.15
5.4.450.0050.02215.67
5.4.440.0040.03715.64
5.4.430.0030.03915.57
5.4.420.0020.02315.57
5.4.410.0050.02015.56
5.4.400.0020.03115.46
5.4.390.0070.02415.44
5.4.380.0080.03515.50
5.4.370.0070.02815.42
5.4.360.0030.04015.46
5.4.350.0070.02515.41
5.4.340.0050.03115.49
5.4.330.0060.00311.80
5.4.320.0050.02815.37
5.4.310.0070.03915.42
5.4.300.0020.02615.41
5.4.290.0020.04215.42
5.4.280.0080.02615.35
5.4.270.0070.03215.39
5.4.260.0030.02515.44
5.4.250.0030.02415.42
5.4.240.0060.01815.44
5.4.230.0020.03615.35
5.4.220.0000.02815.47
5.4.210.0020.02515.48
5.4.200.0100.01615.32
5.4.190.0030.02115.47
5.4.180.0050.04015.48
5.4.170.0030.03215.32
5.4.160.0050.03415.48
5.4.150.0030.04515.50
5.4.140.0030.04314.15
5.4.130.0020.02314.09
5.4.120.0030.03914.09
5.4.110.0030.04014.14
5.4.100.0040.02214.10
5.4.90.0050.03714.14
5.4.80.0070.03514.06
5.4.70.0050.03314.18
5.4.60.0070.03914.16
5.4.50.0000.02614.16
5.4.40.0030.03314.10
5.4.30.0100.03314.15
5.4.20.0030.04014.14
5.4.10.0120.03214.10
5.4.00.0000.03313.86
5.3.290.0050.04013.30
5.3.280.0030.02113.26
5.3.270.0050.03513.21
5.3.260.0020.02413.29
5.3.250.0080.02213.25
5.3.240.0030.03313.29
5.3.230.0030.02313.27
5.3.220.0070.03313.29
5.3.210.0030.04613.18
5.3.200.0030.02713.29
5.3.190.0060.03513.29
5.3.180.0070.03713.25
5.3.170.0110.03313.22
5.3.160.0050.02913.20
5.3.150.0040.02013.24
5.3.140.0080.03713.24
5.3.130.0080.04013.20
5.3.120.0030.04213.20
5.3.110.0080.01813.25
5.3.100.0020.02312.92
5.3.90.0020.02912.96
5.3.80.0060.02012.91
5.3.70.0030.03912.93
5.3.60.0060.01512.99
5.3.50.0070.03512.86
5.3.40.0070.03412.98
5.3.30.0050.03112.91
5.3.20.0030.04012.81
5.3.10.0030.02112.72
5.3.00.0030.02612.76

preferences:
40.31 ms | 401 KiB | 5 Q