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; } $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + ($point->X - $mouseX)*$xCoefs[$i]/$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.0070.01115.13
7.4.00.0070.01014.90
7.3.130.0070.00715.01
7.3.120.0090.00714.90
7.3.110.0070.00914.98
7.3.100.0060.00814.87
7.3.90.0030.01114.91
7.3.80.0100.00514.96
7.3.70.0050.00914.79
7.3.60.0050.00714.92
7.3.50.0030.01014.87
7.3.40.0050.00814.90
7.3.30.0000.01614.75
7.3.20.0060.00816.71
7.3.10.0090.00616.54
7.3.00.0030.01216.81
7.2.260.0060.00915.22
7.2.250.0090.00915.12
7.2.240.0040.00915.38
7.2.230.0040.01015.04
7.2.220.0070.00815.02
7.2.210.0020.01414.85
7.2.200.0080.00715.08
7.2.190.0060.00615.08
7.2.180.0050.01015.04
7.2.170.0080.00315.19
7.2.160.0050.00815.14
7.2.150.0030.01316.90
7.2.140.0020.01216.89
7.2.130.0020.01417.02
7.2.120.0080.00517.04
7.2.110.0080.00516.86
7.2.100.0080.00916.91
7.2.90.0050.01116.87
7.2.80.0030.01416.89
7.2.70.0060.00916.94
7.2.60.0080.00516.91
7.2.50.0020.01116.93
7.2.40.0090.00416.92
7.2.30.0070.01117.03
7.2.20.0080.00816.80
7.2.10.0050.01117.02
7.2.00.0040.00717.70
7.1.330.0070.00915.92
7.1.320.0080.00215.84
7.1.310.0020.01215.68
7.1.300.0020.01215.83
7.1.290.0070.00615.96
7.1.280.0060.01015.77
7.1.270.0060.00815.91
7.1.260.0030.01015.82
7.1.250.0040.00915.86
7.1.240.0110.00315.76
7.1.230.0090.00315.88
7.1.220.0050.00515.96
7.1.210.0070.01015.73
7.1.200.0110.00616.01
7.1.190.0030.01015.98
7.1.180.0030.01015.89
7.1.170.0120.00015.71
7.1.160.0030.01015.92
7.1.150.0040.01115.86
7.1.140.0040.00715.77
7.1.130.0030.01015.76
7.1.120.0030.01015.77
7.1.110.0060.00615.70
7.1.100.0040.01215.92
7.1.90.0090.00615.92
7.1.80.0070.00316.02
7.1.70.0080.00216.54
7.1.60.0090.01017.64
7.1.50.0070.00716.19
7.1.40.0040.00815.73
7.1.30.0040.01115.66
7.1.20.0000.01515.56
7.1.10.0150.00315.68
7.1.00.0100.03319.13
7.0.330.0040.00815.43
7.0.320.0000.01115.38
7.0.310.0070.01015.61
7.0.300.0030.01315.22
7.0.290.0100.00615.44
7.0.280.0060.01015.39
7.0.270.0070.00415.27
7.0.260.0030.01015.60
7.0.250.0070.00715.31
7.0.240.0000.01415.39
7.0.230.0120.00415.43
7.0.220.0000.01115.23
7.0.210.0000.01415.34
7.0.200.0040.00616.14
7.0.190.0090.00315.39
7.0.180.0030.00915.55
7.0.170.0110.00415.21
7.0.160.0070.00715.24
7.0.150.0000.00915.35
7.0.140.0050.04218.82
7.0.130.0030.01615.59
7.0.120.0060.01315.23
7.0.110.0000.01415.39
7.0.100.0100.00315.45
7.0.90.0040.00815.37
7.0.80.0100.00315.43
7.0.70.0070.00315.59
7.0.60.0050.04617.75
7.0.50.0070.03716.69
7.0.40.0020.04916.60
7.0.30.0200.03816.91
7.0.20.0150.04916.81
7.0.10.0040.04116.89
7.0.00.0090.03016.92
5.6.400.0040.00814.69
5.6.390.0030.00614.31
5.6.380.0000.01314.28
5.6.370.0030.00814.71
5.6.360.0040.00814.18
5.6.350.0030.00714.54
5.6.340.0070.00714.31
5.6.330.0000.01414.18
5.6.320.0080.00814.35
5.6.310.0070.01014.46
5.6.300.0100.00314.70
5.6.290.0100.00414.34
5.6.280.0080.03717.91
5.6.270.0040.01214.57
5.6.260.0060.00614.79
5.6.250.0030.01314.42
5.6.240.0060.00614.52
5.6.230.0090.00614.48
5.6.220.0000.01314.41
5.6.210.0120.03917.33
5.6.200.0020.02416.31
5.6.190.0130.02417.41
5.6.180.0200.04317.48
5.6.170.0130.03017.45
5.6.160.0100.02617.54
5.6.150.0110.02516.13
5.6.140.0060.04316.20
5.6.130.0050.04916.23
5.6.120.0070.04417.76
5.6.110.0060.02517.85
5.6.100.0080.04717.70
5.6.90.0070.03517.78
5.6.80.0080.04017.44
5.6.70.2270.02317.42
5.6.60.0000.01614.36
5.6.50.0030.01214.39
5.6.40.0030.01014.24
5.6.30.0070.00414.36
5.6.20.0070.00714.19
5.6.10.0060.00614.38
5.6.00.0060.00614.10
5.5.380.0030.01014.48
5.5.370.0060.00614.51
5.5.360.0110.00414.69
5.5.350.0140.03517.35
5.5.340.0030.02816.19
5.5.330.0020.02717.49
5.5.320.0050.02317.20
5.5.310.0200.01817.53
5.5.300.0120.04216.25
5.5.290.0040.02616.28
5.5.280.0050.02917.58
5.5.270.0030.02817.68
5.5.260.0070.03617.66
5.5.250.0050.02217.33
5.5.240.0170.04017.26
5.5.230.0120.00314.43
5.5.220.0000.01314.52
5.5.210.0080.00614.60
5.5.200.0040.00414.09
5.5.190.0000.01114.36
5.5.180.0000.01714.50
5.5.170.0000.01214.51
5.5.160.0000.01414.52
5.5.150.0030.00914.35
5.5.140.0080.00414.16
5.5.130.0100.00614.62
5.5.120.0030.00614.57
5.5.110.0030.00614.19
5.5.100.0060.00914.34
5.5.90.0110.00414.48
5.5.80.0040.01414.47
5.5.70.0030.01014.69
5.5.60.0070.00714.44
5.5.50.0060.00614.27
5.5.40.0030.00714.46
5.5.30.0040.01114.16
5.5.20.0070.00714.46
5.5.10.0000.01314.36
5.5.00.0000.01014.57
5.4.450.0480.03515.37
5.4.440.0100.03515.46
5.4.430.0080.03315.27
5.4.420.0100.03215.51
5.4.410.0130.03015.45
5.4.400.0120.03415.29
5.4.390.0130.02815.13
5.4.380.0210.03314.94
5.4.370.0310.02214.92
5.4.360.0220.02515.05
5.4.350.0150.03914.94
5.4.340.0170.03114.93
5.4.330.0090.00011.16
5.4.320.0080.02311.84
5.4.310.0050.02211.90
5.4.300.0070.02011.93
5.4.290.0070.01811.84
5.4.280.0070.02811.90
5.4.270.0060.02711.77
5.4.260.0070.02611.81
5.4.250.0060.02711.77
5.4.240.0070.02811.87
5.4.230.0090.02611.88
5.4.220.0120.04311.87
5.4.210.0040.02211.77
5.4.200.0040.02611.87
5.4.190.0060.03011.88
5.4.180.0060.02711.77
5.4.170.0060.02611.78
5.4.160.0070.02811.80
5.4.150.0060.03511.77
5.4.140.0070.03011.64
5.4.130.0110.02811.66
5.4.120.0050.03411.65
5.4.110.0070.03011.58
5.4.100.0060.03211.62
5.4.90.0080.02711.69
5.4.80.0040.03411.63
5.4.70.0070.03111.64
5.4.60.0090.03111.58
5.4.50.0090.05711.58
5.4.40.0070.05911.65
5.4.30.0050.02911.57
5.4.20.0050.03311.72
5.4.10.0140.05611.57
5.4.00.0100.05611.32
5.3.290.0070.02111.98
5.3.280.0130.05811.94
5.3.270.0200.06411.94
5.3.260.0090.03611.94
5.3.250.0150.05111.94
5.3.240.0110.03511.94
5.3.230.0120.04711.94
5.3.220.0070.02811.92
5.3.210.0060.03011.92
5.3.200.0060.03011.92
5.3.190.0060.03011.92
5.3.180.0050.03711.92
5.3.170.0110.02911.92
5.3.160.0060.03011.92
5.3.150.0100.02711.92
5.3.140.0050.02911.91
5.3.130.0040.03511.91
5.3.120.0120.02911.91
5.3.110.0080.03211.91
5.3.100.0090.02811.64
5.3.90.0060.02911.63
5.3.80.0040.02311.63
5.3.70.0080.02111.63
5.3.60.0040.02511.63
5.3.50.0110.02511.59
5.3.40.0040.03211.59
5.3.30.0100.02911.57
5.3.20.0090.02711.46
5.3.10.0070.03211.45
5.3.00.0080.03111.44
5.2.170.0080.0749.22
5.2.160.0060.0419.21
5.2.150.0060.0339.21
5.2.140.0070.0429.21
5.2.130.0100.0419.17
5.2.120.0100.0409.17
5.2.110.0090.0409.18
5.2.100.0080.0429.18
5.2.90.0090.0399.17
5.2.80.0090.0439.18
5.2.70.0080.0459.17
5.2.60.0080.0439.12
5.2.50.0040.0469.10
5.2.40.0100.0389.07
5.2.30.0060.0429.05
5.2.20.0060.0399.03
5.2.10.0100.0368.96
5.2.00.0060.0438.82
5.1.60.0090.0338.11
5.1.50.0070.0368.11
5.1.40.0080.0348.09
5.1.30.0080.0358.44
5.1.20.0070.0398.46
5.1.10.0080.0338.19
5.1.00.0050.0388.19
5.0.50.0050.0286.67
5.0.40.0050.0266.53
5.0.30.0060.0396.35
5.0.20.0080.0236.31
5.0.10.0070.0276.29
5.0.00.0050.0406.28
4.4.90.0060.0194.77
4.4.80.0050.0224.75
4.4.70.0060.0204.75
4.4.60.0070.0194.75
4.4.50.0060.0234.77
4.4.40.0040.0374.71
4.4.30.0060.0224.76
4.4.20.0040.0244.84
4.4.10.0050.0244.85
4.4.00.0100.0314.76
4.3.110.0120.0274.66
4.3.100.0070.0364.66
4.3.90.0050.0204.63
4.3.80.0030.0324.58
4.3.70.0150.0364.63
4.3.60.0070.0324.63
4.3.50.0050.0234.63
4.3.40.0040.0394.54
4.3.30.0050.0203.28
4.3.20.0020.0183.27
4.3.10.0020.0233.23
4.3.00.0300.02310.30

preferences:
69.51 ms | 400 KiB | 5 Q