3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Move { var $direction; var $value; var $x; var $y; public static function initializeEmpty(){ return (new Move(array(0, 0), "NONE", -2)); } public function __construct($pos, $direction, $value){ $this->y = $pos[0]; $this->x = $pos[1]; $this->value = $value; $this->direction = $direction; } public function compare($move){ echo "HERE"; print_r($move); print_r($this); echo "DONE"; return $move->value > $this->value ? $move->value : $this->value; } public static function maxValDirection($moves){ $best = Move::initializeEmpty(); foreach($moves as $m){ print_r($m); $best = $m->compare($best); } return $best; } } $m1 = Move::initializeEmpty(); $m2 = new Move(array(0, 1), "RIGHT", 10); print_r(Move::maxValDirection(array($m1, $m2))); ?>

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.0140.00716.75
8.3.50.0120.00921.91
8.3.40.0040.01118.82
8.3.30.0060.00918.73
8.3.20.0110.00421.92
8.3.10.0060.00323.61
8.3.00.0030.00519.50
8.2.180.0090.00917.00
8.2.170.0070.00722.96
8.2.160.0080.01120.27
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0060.00320.45
8.2.120.0040.00426.35
8.2.110.0060.00320.43
8.2.100.0080.00417.93
8.2.90.0080.00019.40
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0090.00018.05
8.2.50.0060.00318.07
8.2.40.0000.00719.34
8.2.30.0040.00420.53
8.2.20.0050.00517.84
8.2.10.0070.00018.07
8.2.00.0040.00418.06
8.1.280.0100.01025.92
8.1.270.0060.00323.86
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00624.02
8.1.230.0060.00617.43
8.1.220.0040.00417.89
8.1.210.0060.00318.77
8.1.200.0030.00717.25
8.1.190.0040.00417.77
8.1.180.0000.00818.10
8.1.170.0000.00918.52
8.1.160.0040.00421.97
8.1.150.0040.00418.82
8.1.140.0000.00819.58
8.1.130.0000.00717.78
8.1.120.0000.00817.49
8.1.110.0020.00517.39
8.1.100.0000.01117.54
8.1.90.0040.00417.52
8.1.80.0040.00417.37
8.1.70.0060.00317.53
8.1.60.0090.00417.61
8.1.50.0070.00017.43
8.1.40.0080.00017.61
8.1.30.0000.00817.57
8.1.20.0000.00817.60
8.1.10.0070.00017.61
8.1.00.0000.00817.50
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0040.00418.36
8.0.270.0030.00517.20
8.0.260.0000.00617.34
8.0.250.0030.00317.04
8.0.240.0070.00016.94
8.0.230.0000.00717.00
8.0.220.0030.00517.00
8.0.210.0040.00416.93
8.0.200.0030.00316.92
8.0.190.0030.00617.03
8.0.180.0000.00816.86
8.0.170.0090.00016.90
8.0.160.0070.00017.08
8.0.150.0080.00017.00
8.0.140.0040.00416.93
8.0.130.0000.00513.39
8.0.120.0060.00316.84
8.0.110.0000.00717.01
8.0.100.0000.00716.84
8.0.90.0040.00417.04
8.0.80.0090.00617.04
8.0.70.0040.00416.83
8.0.60.0000.00817.05
8.0.50.0040.00417.06
8.0.30.0160.00317.05
8.0.20.0130.00817.40
8.0.10.0040.00417.11
8.0.00.0070.01216.82
7.4.330.0050.00016.85
7.4.320.0000.00716.65
7.4.300.0030.00316.63
7.4.290.0070.00016.68
7.4.280.0030.00616.63
7.4.270.0000.00716.55
7.4.260.0050.00216.51
7.4.250.0030.00516.56
7.4.240.0020.00516.61
7.4.230.0040.00416.70
7.4.220.0030.01616.55
7.4.210.0100.01016.43
7.4.200.0030.00316.48
7.4.160.0100.00716.61
7.4.150.0060.01317.40
7.4.140.0110.01017.86
7.4.130.0130.00516.64
7.4.120.0140.00316.47
7.4.110.0090.00916.54
7.4.100.0110.00716.67
7.4.90.0090.00916.41
7.4.80.0120.00919.39
7.4.70.0160.00616.55
7.4.60.0070.01116.39
7.4.50.0070.01016.58
7.4.40.0090.00616.70
7.4.30.0090.00916.65
7.4.00.0070.01014.90
7.3.330.0020.00313.23
7.3.320.0060.00013.31
7.3.310.0030.00316.45
7.3.300.0030.00316.45
7.3.290.0080.00716.37
7.3.280.0080.00916.37
7.3.270.0060.01117.40
7.3.260.0090.00816.53
7.3.250.0120.00616.51
7.3.240.0050.01216.59
7.3.230.0140.00716.43
7.3.210.0080.00816.52
7.3.200.0120.00416.61
7.3.190.0090.01316.56
7.3.180.0080.00816.69
7.3.170.0030.01416.36
7.3.160.0080.00816.53
7.3.10.0120.00816.66
7.3.00.0080.01216.78
7.2.330.0100.00716.84
7.2.320.0110.00616.77
7.2.310.0110.01116.75
7.2.300.0080.01216.50
7.2.290.0100.01016.77
7.2.130.0230.00616.75
7.2.120.0120.00916.70
7.2.110.0060.01216.71
7.2.100.0040.01316.83
7.2.90.0100.00816.92
7.2.80.0120.00216.41
7.2.70.0130.00617.00
7.2.60.0110.01116.90
7.2.50.0100.00516.88
7.2.40.0090.00616.75
7.2.30.0140.00316.60
7.2.20.0030.01016.43
7.2.10.0130.00716.88
7.2.00.0090.00917.84
7.1.250.0080.01115.77
7.1.240.0090.01215.50
7.1.230.0050.00915.80
7.1.220.0000.01515.70
7.1.210.0140.00415.40
7.1.200.0110.01115.66
7.1.190.0090.00415.80
7.1.180.0100.00315.83
7.1.170.0080.00315.45
7.1.160.0040.00415.76
7.1.150.0100.00315.93
7.1.140.0060.01215.88
7.1.130.0040.00415.73
7.1.120.0070.00715.62
7.1.110.0000.01415.67
7.1.100.0570.00515.76
7.1.90.0080.00815.54
7.1.80.0040.00815.76
7.1.70.0030.00916.45
7.1.60.0100.00817.50
7.1.50.0080.00516.20
7.1.40.0080.00715.40
7.1.30.0140.00315.71
7.1.20.0080.00615.67
7.1.10.0000.01215.59
7.1.00.0050.04318.96
7.0.330.0190.00015.11
7.0.320.0140.00715.51
7.0.310.0060.00315.35
7.0.300.0090.00315.46
7.0.290.0100.01015.32
7.0.280.0030.01015.30
7.0.270.0140.00015.23
7.0.260.0040.00715.16
7.0.250.0040.01115.35
7.0.240.0000.01515.23
7.0.230.0030.01215.12
7.0.220.0070.00715.21
7.0.210.0060.00615.37
7.0.200.0010.01016.20
7.0.190.0030.00715.49
7.0.180.0090.00015.38
7.0.170.0060.00615.36
7.0.160.0030.01015.21
7.0.150.0040.00415.49
7.0.140.0100.00315.36
7.0.130.0030.01015.20
7.0.120.0030.01315.45
7.0.110.0120.00615.32
7.0.100.0080.00615.57
7.0.90.0050.00514.94
7.0.80.0030.01015.29
7.0.70.0090.00915.04
7.0.60.0070.04517.62
7.0.50.0070.04316.67
7.0.40.0040.04716.76
7.0.30.0130.03016.63
7.0.20.0120.02816.69
7.0.10.0070.04816.75
7.0.00.0100.02716.80
5.6.380.0040.01614.44
5.6.370.0100.00614.62
5.6.360.0070.00314.11
5.6.350.0070.00314.62
5.6.340.0060.00614.76
5.6.330.0030.00914.26
5.6.320.0090.00614.03
5.6.310.0040.01114.38
5.6.300.0040.00814.22
5.6.290.0030.00614.43
5.6.280.0080.03617.74
5.6.270.0070.00714.32
5.6.260.0040.00714.20
5.6.250.0080.00014.30
5.6.240.0160.00014.43
5.6.230.0040.01113.85
5.6.220.0070.00314.02
5.6.210.0100.01917.55
5.6.200.0070.03216.22
5.6.190.0020.04617.44
5.6.180.0280.02717.23
5.6.170.0170.03317.23
5.6.160.0070.02617.36
5.6.150.0040.02616.11
5.6.140.0050.04516.10
5.6.130.0030.04516.04
5.6.120.0080.02217.58
5.6.110.0050.04717.80
5.6.100.0050.04017.66
5.6.90.0080.03917.64
5.6.80.0030.04117.40
5.6.70.0000.01414.35
5.6.60.0060.00314.07
5.6.50.0120.00314.40
5.6.40.0030.01014.40
5.6.30.0130.00314.13
5.6.20.0100.00314.06
5.6.10.0040.01113.98
5.6.00.0040.00714.25
5.5.380.0030.00311.37
5.5.370.0000.00910.82
5.5.360.0030.01011.18
5.5.350.0120.01715.75
5.5.340.0020.04014.56
5.5.330.0100.03715.71
5.5.320.0030.02815.85
5.5.310.0100.02715.81
5.5.300.0050.03014.63
5.5.290.0070.02214.54
5.5.280.0020.05215.96
5.5.270.0030.02516.04
5.5.260.0060.02316.06
5.5.250.0060.04115.84
5.5.240.0080.04215.82
5.5.230.0060.00610.96
5.5.220.0000.01010.94
5.5.210.0100.00011.31
5.5.200.0030.00310.97
5.5.190.0040.00711.28
5.5.180.0060.00611.17
5.5.170.0060.00311.16
5.5.160.0070.00311.29
5.5.150.0030.00911.38
5.5.140.0030.01010.86
5.5.130.0030.00311.31
5.5.120.0090.00311.21
5.5.110.0040.00711.04
5.5.100.0080.00311.30
5.5.90.0000.01011.24
5.5.80.0040.00411.32
5.5.70.0040.00811.22
5.5.60.0000.01211.26
5.5.50.0040.00411.18
5.5.40.0040.00811.17
5.5.30.0030.00311.02
5.5.20.0030.01011.20
5.5.10.0030.00511.29
5.5.00.0060.00611.18

preferences:
32.18 ms | 401 KiB | 5 Q