3v4l.org

run code in 300+ PHP versions simultaneously
<?php header("Content-type: image/gif"); $cells = array ( liked=>200, hated=>400, indifferent=>900 ); $max = max( $cells ); $total = count ( $cells ); $totalwidth = 300; $totalheight = 200; $xgutter = 20; // left/right margin $ygutter = 20; // top/bottom margin $internalgap = 10; // space between cells $bottomspace = 30; // gap at the bottom (in addition to margin) $font = "ARIALBD.TTF"; $graphCanX = ( $totalwidth - $xgutter*2 ); $graphCanY = ( $totalheight - $ygutter*2 - $bottomspace );// starting draw position x - axis $posX = $xgutter; // starting draw pos - y - axis $posY = $totalheight - $ygutter - $bottomspace; $cellwidth = (int) (( $graphCanX - ( $internalgap * ( $total-1 ) )) / $total) ; $textsize = (int)($bottomspace); // adjust font size while ( list( $key, $val ) = each ( $cells ) ) { while ( 1 ) { $box = ImageTTFbBox( $textsize, 0, $font, $key ); $textWidth = abs( $box[2] ); if ( $textWidth < $cellwidth ) break; $textsize--; } } $image = imagecreate( $totalwidth, $totalheight ); $red = ImageColorAllocate($image, 255, 0, 0); $blue = ImageColorAllocate($image, 0, 0, 255 ); $black = ImageColorAllocate($image, 0, 0, 0 ); $grey = ImageColorAllocate($image, 100, 100, 100 ); reset ($cells); while ( list( $key, $val ) = each ( $cells ) ) { $cellheight = (int) (($val/$max) * $graphCanY); $center = (int)($posX+($cellwidth/2)); imagefilledrectangle( $image, $posX, ($posY-$cellheight), ($posX+$cellwidth), $posY, $blue ); $box = ImageTTFbBox( $textsize, 0, $font, $key ); $tw = $box[2]; ImageTTFText( $image, $textsize, 0, ($center-($tw/2)), ($totalheight-$ygutter), $black, $font, $key ); $posX += ( $cellwidth + $internalgap); } imagegif( $image );

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.0210.00016.63
8.3.50.0100.01022.11
8.3.40.0070.00718.97
8.3.30.0110.00418.79
8.3.20.0090.00020.01
8.3.10.0050.00323.56
8.3.00.0040.00419.25
8.2.180.0190.00316.75
8.2.170.0040.01122.96
8.2.160.0100.01019.29
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00319.14
8.2.120.0040.00426.16
8.2.110.0030.00621.07
8.2.100.0030.00717.91
8.2.90.0060.00319.89
8.2.80.0080.00017.97
8.2.70.0040.00418.03
8.2.60.0000.00718.09
8.2.50.0030.00518.10
8.2.40.0070.00019.30
8.2.30.0030.00320.66
8.2.20.0060.00317.84
8.2.10.0000.00718.05
8.2.00.0070.00018.04
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0080.00826.35
8.1.250.0080.00028.09
8.1.240.0070.00323.84
8.1.230.0040.00718.96
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0000.00917.23
8.1.180.0040.00418.10
8.1.170.0000.00918.64
8.1.160.0070.00022.07
8.1.150.0000.00818.85
8.1.140.0000.00819.54
8.1.130.0000.00717.57
8.1.120.0070.00017.45
8.1.110.0040.00417.42
8.1.100.0070.00017.32
8.1.90.0070.00017.33
8.1.80.0040.00417.32
8.1.70.0000.00817.27
8.1.60.0040.00417.44
8.1.50.0000.00817.38
8.1.40.0000.00817.46
8.1.30.0040.00417.61
8.1.20.0040.00417.61
8.1.10.0020.00517.59
8.1.00.0040.00417.45
8.0.300.0000.00821.57
8.0.290.0040.00416.75
8.0.280.0080.00018.39
8.0.270.0040.00417.29
8.0.260.0030.00317.25
8.0.250.0030.00316.95
8.0.240.0040.00417.06
8.0.230.0000.00717.04
8.0.220.0030.00316.89
8.0.210.0000.00717.02
8.0.200.0040.00417.04
8.0.190.0040.00417.05
8.0.180.0000.00816.97
8.0.170.0050.00316.98
8.0.160.0000.00817.07
8.0.150.0040.00416.87
8.0.140.0000.00816.89
8.0.130.0060.00013.42
8.0.120.0000.00717.02
8.0.110.0000.00716.96
8.0.100.0050.00216.95
8.0.90.0000.00716.83
8.0.80.0120.01017.03
8.0.70.0000.00716.93
8.0.60.0060.00316.85
8.0.50.0080.00016.98
8.0.30.0110.01117.06
8.0.20.0080.01117.40
8.0.10.0040.00417.04
8.0.00.0080.01216.85
7.4.330.0000.00516.83
7.4.320.0030.00316.55
7.4.300.0030.00316.54
7.4.290.0000.00716.58
7.4.280.0060.00316.65
7.4.270.0000.00716.62
7.4.260.0000.00716.53
7.4.250.0040.00416.58
7.4.240.0040.00416.62
7.4.230.0000.00716.65
7.4.220.0180.00716.55
7.4.210.0060.01216.57
7.4.200.0040.00316.63
7.4.160.0140.00716.72
7.4.150.0150.00317.40
7.4.140.0150.00617.86
7.4.130.0120.00916.61
7.4.120.0110.00616.69
7.4.110.0000.01716.59
7.4.100.0130.01016.62
7.4.90.0000.01716.61
7.4.80.0170.00719.39
7.4.70.0040.01316.43
7.4.60.0100.00616.61
7.4.50.0030.01016.74
7.4.40.0130.00316.52
7.4.30.0140.00316.54
7.4.00.0080.00415.06
7.3.330.0000.00513.22
7.3.320.0050.00013.18
7.3.310.0080.00016.26
7.3.300.0050.00216.46
7.3.290.0040.01316.39
7.3.280.0110.00816.41
7.3.270.0120.00617.40
7.3.260.0080.00816.42
7.3.250.0100.01016.44
7.3.240.0080.01216.56
7.3.230.0100.00716.48
7.3.210.0100.00716.42
7.3.200.0090.00916.29
7.3.190.0100.01016.50
7.3.180.0060.01516.27
7.3.170.0100.01416.54
7.3.160.0090.00616.63
7.3.10.0090.00716.23
7.3.00.0140.00816.19
7.2.330.0090.00916.61
7.2.320.0040.01516.78
7.2.310.0060.01616.79
7.2.300.0190.00016.49
7.2.290.0060.01016.61
7.2.130.0100.00716.68
7.2.120.0170.01017.04
7.2.110.0140.00516.61
7.2.100.0170.00316.07
7.2.90.0110.01116.87
7.2.80.0140.00916.79
7.2.70.0070.01016.67
7.2.60.0020.01316.72
7.2.50.0110.00916.32
7.2.40.0230.00416.57
7.2.30.0070.01316.55
7.2.20.0230.00416.88
7.2.10.0160.00516.70
7.2.00.0080.01118.21
7.1.250.0150.01115.18
7.1.200.0030.01215.68
7.1.100.1990.00616.10
7.1.70.0030.00917.05
7.1.60.0120.01219.36
7.1.50.0090.01316.51
7.1.00.0030.07722.36
7.0.200.0030.00716.63
7.0.60.0000.09319.98
7.0.50.0170.07317.77
7.0.40.0130.07720.21
7.0.30.0370.04720.00
7.0.20.0300.08020.00
7.0.10.0030.06720.00
7.0.00.0100.08720.12
5.6.280.0070.04320.89
5.6.210.0170.07020.52
5.6.200.0070.05718.21
5.6.190.0130.03720.46
5.6.180.0500.05320.77
5.6.170.0170.04020.50
5.6.160.0100.08020.56
5.6.150.0000.08718.17
5.6.140.0170.02718.15
5.6.130.0030.04018.18
5.6.120.0070.08321.00
5.6.110.0070.09021.02
5.6.100.0100.07321.01
5.6.90.0070.08320.99
5.6.80.0130.07320.37
5.5.350.0130.04020.50
5.5.340.0070.03718.02
5.5.330.0100.06320.23
5.5.320.0070.07020.20
5.5.310.0300.06720.27
5.5.300.0100.04317.88
5.5.290.0000.04718.00
5.5.280.0070.04020.81
5.5.270.0170.07320.77
5.5.260.0070.06020.74
5.5.250.0100.06720.71
5.5.240.0230.07720.38

preferences:
44.52 ms | 401 KiB | 5 Q