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 = 10; $mouseX = 200; $mouseY = 200; $point = new Point(300, 300); $delta = 1/(1-rand(0, 99)/100); if (rand(0, 1) == 0) { $delta = 1/$delta; } $xCoefs = array($delta); for ( $i=1; $i<=$moves; $i++ ) { $xCoefs[$i] = $xCoefs[$i-1] - ($delta - 1/$delta)/$moves; } echo $delta.' -> '.(1/$delta)."\r\n"; $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + ($point->X - $mouseX)*$xCoefs[$i-1]/$moves; $y = $points[$i-1]->Y + ($point->Y - $mouseY)/$moves; echo $x.';'.$y.' (coef '.$xCoefs[$i].')'."\r\n"; $points[] = new Point($x, $y); }

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.0090.00915.05
7.4.00.0070.00814.88
7.3.130.0120.00814.93
7.3.120.0050.00914.78
7.3.110.0050.01214.81
7.3.100.0030.01214.85
7.3.90.0090.00614.78
7.3.80.0070.00714.91
7.3.70.0090.00514.84
7.3.60.0030.00814.81
7.3.50.0060.00714.83
7.3.40.0070.00414.67
7.3.30.0060.00814.68
7.3.20.0030.01116.59
7.3.10.0070.00616.51
7.3.00.0060.00716.58
7.2.260.0090.00915.27
7.2.250.0060.01115.12
7.2.240.0110.00815.11
7.2.230.0120.00315.05
7.2.220.0050.01015.12
7.2.210.0040.00815.04
7.2.200.0040.00714.93
7.2.190.0090.00614.83
7.2.180.0050.00915.05
7.2.170.0070.00715.10
7.2.160.0150.00014.99
7.2.150.0120.00316.88
7.2.140.0100.00316.88
7.2.130.0050.01016.76
7.2.120.0110.00316.85
7.2.110.0080.00816.82
7.2.100.0100.00516.87
7.2.90.0100.01116.88
7.2.80.0080.00516.65
7.2.70.0080.00816.90
7.2.60.0100.00616.75
7.2.50.0100.00617.05
7.2.40.0120.00516.98
7.2.30.0090.00716.88
7.2.20.0080.01016.80
7.2.10.0060.00816.86
7.2.00.0080.00917.80
7.1.330.0060.01015.70
7.1.320.0070.00715.77
7.1.310.0070.00715.83
7.1.300.0060.00715.79
7.1.290.0050.00715.71
7.1.280.0040.00715.94
7.1.270.0070.00715.87
7.1.260.0030.01015.69
7.1.250.0040.01115.71
7.1.240.0040.00415.71
7.1.230.0030.00915.70
7.1.220.0110.00415.89
7.1.210.0030.01015.62
7.1.200.0030.00915.87
7.1.190.0120.00315.75
7.1.180.0000.01015.96
7.1.170.0070.00715.66
7.1.160.0070.01015.81
7.1.150.0070.00415.82
7.1.140.0100.00715.87
7.1.130.0100.00315.93
7.1.120.0040.01115.71
7.1.110.0040.01115.93
7.1.100.0100.00315.86
7.1.90.0040.00715.77
7.1.80.0100.00715.96
7.1.70.0050.01016.47
7.1.60.0120.00817.70
7.1.50.0000.01616.34
7.1.40.0000.01415.93
7.1.30.0060.01015.57
7.1.20.0000.01515.89
7.1.10.0060.00615.75
7.1.00.0060.03719.06
7.0.330.0050.00315.50
7.0.320.0060.00615.30
7.0.310.0040.01115.22
7.0.300.0060.00915.50
7.0.290.0070.00415.61
7.0.280.0060.00615.12
7.0.270.0030.01015.41
7.0.260.0000.01415.46
7.0.250.0070.01015.44
7.0.240.0070.01015.52
7.0.230.0090.00615.33
7.0.220.0030.01015.52
7.0.210.0030.01015.63
7.0.200.0090.00216.14
7.0.190.0060.00315.47
7.0.180.0000.01215.31
7.0.170.0090.00615.52
7.0.160.0070.00415.50
7.0.150.0000.01015.44
7.0.140.0040.04218.74
7.0.130.0040.00715.55
7.0.120.0070.00715.41
7.0.110.0060.00315.44
7.0.100.0030.01215.22
7.0.90.0100.00315.32
7.0.80.0040.00815.47
7.0.70.0100.01015.60
7.0.60.0070.04517.72
7.0.50.0060.03516.81
7.0.40.0030.04916.70
7.0.30.0180.02316.97
7.0.20.0260.03916.74
7.0.10.0040.05216.76
7.0.00.0020.05116.71
5.6.400.0070.00714.59
5.6.390.0000.01514.37
5.6.380.0090.00614.77
5.6.370.0040.00814.27
5.6.360.0060.00914.77
5.6.350.0040.00714.59
5.6.340.0000.01414.52
5.6.330.0000.01414.41
5.6.320.0000.01414.61
5.6.310.0090.00614.15
5.6.300.0000.01414.38
5.6.290.0060.01014.33
5.6.280.0080.03817.60
5.6.270.0030.00914.46
5.6.260.0030.00914.57
5.6.250.0030.01014.65
5.6.240.0040.01514.42
5.6.230.0040.01114.52
5.6.220.0090.00614.54
5.6.210.0030.02517.50
5.6.200.0080.03416.38
5.6.190.0070.03417.51
5.6.180.0080.04817.46
5.6.170.0130.04417.50
5.6.160.0090.03517.48
5.6.150.0120.02916.33
5.6.140.0040.04516.28
5.6.130.0080.03516.39
5.6.120.0030.04617.59
5.6.110.0080.04117.75
5.6.100.0050.02917.95
5.6.90.0050.04717.69
5.6.80.0030.04717.51
5.6.70.0060.00914.60
5.6.60.0030.00914.42
5.6.50.0110.00414.54
5.6.40.0030.00714.16
5.6.30.0110.00414.72
5.6.20.0060.01014.60
5.6.10.0040.01114.52
5.6.00.0030.00714.30
5.5.380.0000.01714.50
5.5.370.0090.00614.67
5.5.360.0070.01114.45
5.5.350.0030.02217.29
5.5.340.0100.03616.19
5.5.330.0060.04317.34
5.5.320.0100.02717.28
5.5.310.0150.04517.41
5.5.300.0050.03516.19
5.5.290.0080.03316.34
5.5.280.0070.04717.53
5.5.270.0120.04017.63
5.5.260.0090.04317.49
5.5.250.0070.04017.49
5.5.240.0050.02917.41
5.5.230.0040.00814.28
5.5.220.0070.00714.10
5.5.210.0100.00614.57
5.5.200.0040.00414.41
5.5.190.0030.01014.23
5.5.180.0030.01414.21
5.5.170.0070.00314.32
5.5.160.0120.00314.41
5.5.150.0100.00314.57
5.5.140.0030.01314.55
5.5.130.0060.00614.40
5.5.120.0100.00614.46
5.5.110.0030.01014.46
5.5.100.0070.00314.23
5.5.90.0030.00514.43
5.5.80.0110.00014.41
5.5.70.0040.00814.01
5.5.60.0040.00714.50
5.5.50.0090.00314.43
5.5.40.0000.01114.50
5.5.30.0120.00014.69
5.5.20.0030.00714.60
5.5.10.0030.00914.43
5.5.00.0070.01114.47
5.4.450.0900.02915.40
5.4.440.0750.02515.48
5.4.430.0830.02315.25
5.4.420.0910.03015.25
5.4.410.0870.02715.15
5.4.400.0850.02715.25
5.4.390.0910.02515.18
5.4.380.0900.02715.22
5.4.370.0850.02315.28
5.4.360.0750.02215.16
5.4.350.0850.02015.13
5.4.340.0870.02715.24
5.4.330.0030.00711.32
5.4.320.0770.02215.31
5.4.310.0870.03215.27
5.4.300.0900.02315.27
5.4.290.0870.02515.22
5.4.280.0720.02515.27
5.4.270.0800.02315.25
5.4.260.0850.03015.31
5.4.250.0870.02515.35
5.4.240.0800.02215.16
5.4.230.0850.02015.08
5.4.220.0830.02615.27
5.4.210.0900.02115.13
5.4.200.0930.02515.05
5.4.190.0780.02315.09
5.4.180.0780.02215.20
5.4.170.0850.02215.24
5.4.160.0750.02115.23
5.4.150.0880.02815.08
5.4.140.0720.01913.80
5.4.130.0820.02513.90
5.4.120.0840.01813.91
5.4.110.0770.02013.95
5.4.100.0770.02713.77
5.4.90.0980.01813.94
5.4.80.0900.02813.86
5.4.70.0900.02413.93
5.4.60.0890.02413.92
5.4.50.0900.02213.75
5.4.40.0830.02513.93
5.4.30.0910.02113.94
5.4.20.0880.02513.85
5.4.10.0800.02013.77
5.4.00.0810.02013.53
5.3.290.0850.02312.96
5.3.280.0760.02512.93
5.3.270.0850.02213.00
5.3.260.0830.02512.96
5.3.250.0810.01812.97
5.3.240.0800.02012.92
5.3.230.0800.02213.03
5.3.220.0820.02312.95
5.3.210.0770.02212.92
5.3.200.0830.01813.01
5.3.190.0860.02013.00
5.3.180.0900.02613.03
5.3.170.0830.02512.91
5.3.160.0940.02012.94
5.3.150.0850.02413.03
5.3.140.0820.01813.01
5.3.130.0770.02412.90
5.3.120.0800.02012.99
5.3.110.0810.02012.93
5.3.100.0880.02312.69
5.3.90.0870.03012.79
5.3.80.0990.02212.71
5.3.70.1050.02312.69
5.3.60.0940.02412.79
5.3.50.0750.02412.65
5.3.40.0780.02412.71
5.3.30.0770.01912.66
5.3.20.0850.02512.52
5.3.10.0910.02112.61
5.3.00.0880.02712.44
5.2.170.1400.03711.06
5.2.160.1430.03311.12
5.2.150.1230.03011.17
5.2.140.1470.03711.07
5.2.130.1500.03711.05
5.2.120.1430.03011.05
5.2.110.1230.02711.13
5.2.100.1500.03011.08
5.2.90.1200.03311.04
5.2.80.1430.02711.04
5.2.70.1530.02711.01
5.2.60.1470.03311.14
5.2.50.1370.03711.11
5.2.40.1200.03010.94
5.2.30.1130.04010.96
5.2.20.1130.03311.06
5.2.10.1130.04010.96
5.2.00.1100.03010.68
5.1.60.1000.0239.92
5.1.50.0070.0209.95
5.1.40.0000.05710.14
5.1.30.0000.03710.25
5.1.20.0030.06010.27
5.1.10.1130.02710.22
5.1.00.1230.04010.02
5.0.50.0570.0278.47
5.0.40.0800.0338.49
5.0.30.0830.0408.23
5.0.20.0770.0178.46
5.0.10.0770.0278.13
5.0.00.0830.0438.41
4.4.90.0770.0177.83
4.4.80.0700.0177.83
4.4.70.0830.0207.83
4.4.60.0870.0237.83
4.4.50.0770.0237.83
4.4.40.0730.0337.83
4.4.30.0730.0177.83
4.4.20.0730.0177.84
4.4.10.0670.0137.84
4.4.00.0600.0307.85
4.3.110.0500.0137.85
4.3.100.0670.0137.85
4.3.90.0570.0137.85
4.3.80.0470.0277.87
4.3.70.0670.0237.88
4.3.60.0600.0107.88
4.3.50.0600.0277.88
4.3.40.0700.0337.88
4.3.30.0300.0177.89
4.3.20.0230.0177.89
4.3.10.0300.0137.89
4.3.00.0400.0277.90

preferences:
34.64 ms | 401 KiB | 5 Q