3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "?announce=[-tg-station] thingy opened fart&key=this_is_a_test_key"; $port = 7812; $addr = "94.21.30.22"; // All queries must begin with a question mark (ie "?players") if($str{0} != '?') $str = ('?' . $str); /* --- Prepare a packet to send to the server (based on a reverse-engineered packet structure) --- */ $query = "\x00\x83" . pack('n', strlen($str) + 6) . "\x00\x00\x00\x00\x00" . $str . "\x00"; /* --- Create a socket and connect it to the server --- */ $server = socket_create(AF_INET,SOCK_STREAM,SOL_TCP) or die('Unable to create export socket.'); if(!socket_connect($server,$addr,$port)) { return "ERROR"; } /* --- Send bytes to the server. Loop until all bytes have been sent --- */ $bytestosend = strlen($query); $bytessent = 0; while ($bytessent < $bytestosend) { //echo $bytessent.'<br>'; $result = socket_write($server,substr($query,$bytessent),$bytestosend-$bytessent); //echo 'Sent '.$result.' bytes<br>'; if ($result===FALSE) die(socket_strerror(socket_last_error())); $bytessent += $result; } /* --- Idle for a while until recieved bytes from game server --- */ $result = socket_read($server, 10000, PHP_BINARY_READ); socket_close($server); // we don't need this anymore ?>

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.0130.00718.43
8.3.50.0130.00722.10
8.3.40.0040.01118.71
8.3.30.0070.00719.02
8.3.20.0050.00320.16
8.3.10.0000.00822.14
8.3.00.0030.00522.47
8.2.180.0170.00316.50
8.2.170.0070.01022.96
8.2.160.0030.01020.43
8.2.150.0090.00624.18
8.2.140.0090.00024.66
8.2.130.0110.00426.16
8.2.120.0040.00419.36
8.2.110.0070.00320.32
8.2.100.0080.00417.66
8.2.90.0060.00319.09
8.2.80.0030.00517.97
8.2.70.0000.00817.38
8.2.60.0040.00417.78
8.2.50.0000.00818.07
8.2.40.0040.00418.22
8.2.30.0090.00017.97
8.2.20.0020.00517.63
8.2.10.0060.00317.63
8.2.00.0040.00417.42
8.1.280.0070.00725.92
8.1.270.0030.00522.14
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.92
8.1.230.0070.00418.97
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00617.13
8.1.190.0000.00817.39
8.1.180.0110.00018.10
8.1.170.0030.00518.50
8.1.160.0030.00521.98
8.1.150.0050.00218.55
8.1.140.0070.00017.35
8.1.130.0030.00317.74
8.1.120.0000.00717.25
8.1.110.0080.00017.35
8.1.100.0000.00817.29
8.1.90.0040.00417.29
8.1.80.0030.00317.37
8.1.70.0060.00017.33
8.1.60.0000.00817.36
8.1.50.0040.00417.40
8.1.40.0080.00017.38
8.1.30.0040.00417.46
8.1.20.0060.00317.54
8.1.10.0050.00317.31
8.1.00.0040.00417.19
8.0.300.0060.00318.77
8.0.290.0030.00316.93
8.0.280.0070.00018.20
8.0.270.0030.00517.00
8.0.260.0030.00316.79
8.0.250.0000.00716.77
8.0.240.0040.00416.71
8.0.230.0080.00016.85
8.0.220.0030.00316.71
8.0.210.0070.00016.79
8.0.200.0030.00316.89
8.0.190.0000.00716.85
8.0.180.0050.00216.75
8.0.170.0000.00816.77
8.0.160.0000.00916.76
8.0.150.0030.00616.80
8.0.140.0000.00716.75
8.0.130.0000.00513.17
8.0.120.0000.00816.77
8.0.110.0000.00716.89
8.0.100.0040.00416.78
8.0.90.0040.00416.89
8.0.80.0060.00916.81
8.0.70.0040.00416.77
8.0.60.0000.00716.81
8.0.50.0040.00416.79
8.0.30.0130.00717.00
8.0.20.0150.00517.40
8.0.10.0040.00416.84
8.0.00.0120.00716.48
7.4.330.0030.00315.14
7.4.320.0000.00816.50
7.4.300.0030.00316.51
7.4.290.0070.00016.52
7.4.280.0000.00716.55
7.4.270.0070.00016.64
7.4.260.0070.00016.42
7.4.250.0000.00716.55
7.4.240.0020.00616.54
7.4.230.0000.00716.26
7.4.220.0080.00816.63
7.4.210.0090.00516.64
7.4.200.0040.00316.70
7.4.190.0070.00016.65
7.4.160.0030.01316.39
7.4.150.0120.00617.40
7.4.140.0110.00617.86
7.4.130.0030.01716.57
7.4.120.0070.01116.64
7.4.110.0170.00016.61
7.4.100.0120.00816.64
7.4.90.0090.00916.56
7.4.80.0120.01219.39
7.4.70.0040.01116.58
7.4.60.0090.00916.61
7.4.50.0000.00416.59
7.4.40.0040.00822.77
7.4.30.0100.00716.45
7.4.00.0090.00815.05
7.3.330.0000.00513.27
7.3.320.0050.00013.34
7.3.310.0000.00716.25
7.3.300.0030.00316.26
7.3.290.0110.00416.38
7.3.280.0070.00916.38
7.3.270.0140.00617.40
7.3.260.0180.00016.52
7.3.250.0050.01516.44
7.3.240.0100.00716.37
7.3.230.0060.01516.70
7.3.210.0100.00716.61
7.3.200.0070.01319.39
7.3.190.0060.01216.37
7.3.180.0060.00916.43
7.3.170.0120.00316.45
7.3.160.0100.00716.68
7.3.120.0100.00715.00
7.3.110.0060.00914.82
7.3.100.0060.00614.87
7.3.90.0070.00514.92
7.3.80.0050.00914.92
7.3.70.0070.00914.98
7.3.60.0070.01014.86
7.3.50.0050.01115.00
7.3.40.0040.00714.88
7.3.30.0050.00814.80
7.3.20.0070.00516.65
7.3.10.0080.00616.61
7.3.00.0080.00716.70
7.2.330.0140.00416.59
7.2.320.0070.01016.80
7.2.310.0180.00316.79
7.2.300.0100.00616.61
7.2.290.0110.00916.49
7.2.250.0060.01015.11
7.2.240.0050.01315.06
7.2.230.0050.01115.14
7.2.220.0030.01414.96
7.2.210.0090.00515.00
7.2.200.0030.00814.89
7.2.190.0070.00815.08
7.2.180.0110.00515.09
7.2.170.0070.00914.99
7.2.160.0100.00715.30
7.2.150.0070.01016.98
7.2.140.0060.00616.98
7.2.130.0040.00817.02
7.2.120.0120.00316.98
7.2.110.0070.01017.07
7.2.100.0090.00917.04
7.2.90.0100.00716.72
7.2.80.0060.01217.01
7.2.70.0040.01117.04
7.2.60.0020.01216.92
7.2.50.0060.00916.97
7.2.40.0040.01416.87
7.2.30.0040.01117.02
7.2.20.0040.01116.84
7.2.10.0070.00717.07
7.2.00.0000.01116.97
7.1.330.0070.00515.63
7.1.320.0110.00515.67
7.1.310.0030.01015.58
7.1.300.0070.00715.78
7.1.290.0050.01115.62
7.1.280.0050.00915.78
7.1.270.0110.00315.81
7.1.260.0060.00815.84
7.1.250.0060.01015.61
7.1.200.0200.01015.53
7.1.100.0000.01118.33
7.1.70.0030.00317.21
7.1.60.0100.01619.82
7.1.50.0100.01417.11
7.1.00.0000.08022.36
7.0.200.0030.00616.73
7.0.140.0000.10021.95
7.0.60.0070.08720.04
7.0.50.0070.05017.91
7.0.40.0130.08320.24
7.0.30.0300.06020.21
7.0.20.0300.07720.09
7.0.10.0130.05320.04
7.0.00.0030.05019.99
5.6.280.0070.07020.86
5.6.210.0200.07720.55
5.6.200.0030.04718.19
5.6.190.0030.05020.45
5.6.180.3370.03720.45
5.6.170.0270.06720.42
5.6.160.0070.08720.52
5.6.150.0130.05318.14
5.6.140.0000.04718.11
5.6.130.0130.07318.18
5.6.120.0170.07321.00
5.6.110.0200.07321.09
5.6.100.0070.04021.00
5.6.90.0200.07020.91
5.6.80.0330.05720.38
5.6.70.4300.03720.37
5.5.350.0070.08020.41
5.5.340.0130.06717.98
5.5.330.0070.08320.15
5.5.320.0270.03720.28
5.5.310.0230.09320.23
5.5.300.0070.08317.95
5.5.290.0070.07017.98
5.5.280.0030.08720.88
5.5.270.0070.08020.98
5.5.260.0130.08020.80
5.5.250.0000.04320.70
5.5.240.0070.08320.25
5.4.450.0270.06319.52
5.4.440.0770.05319.63
5.4.430.0130.05319.42
5.4.420.0130.06319.30
5.4.410.0170.05019.35
5.4.400.0070.05318.77
5.4.390.0030.06318.53
5.4.380.0430.07018.50
5.4.370.0330.04318.47
5.4.360.0230.05018.72
5.4.350.0200.06718.50
5.4.340.0170.05318.56
5.4.320.0090.03712.48
5.4.310.0080.04012.47
5.4.300.0060.04212.48
5.4.290.0090.04212.47
5.4.280.0080.03312.37
5.4.270.0070.06018.91
5.4.260.0000.06718.95
5.4.250.0130.06018.91
5.4.240.0030.05718.78
5.4.230.0200.05718.77
5.4.220.0130.05718.88
5.4.210.0130.07018.88
5.4.200.0070.05719.03
5.4.190.0030.05718.84
5.4.180.0200.04018.70
5.4.170.0200.05718.88
5.4.160.0230.06019.01
5.4.150.0030.06318.79
5.4.140.0070.05316.42
5.4.130.0100.04716.23
5.4.120.0100.05716.25
5.4.110.0030.06316.38
5.4.100.0000.06316.26
5.4.90.0170.04016.39
5.4.80.0030.06716.43
5.4.70.0070.06716.41
5.4.60.0130.05316.35
5.4.50.0170.05716.51
5.4.40.0100.05016.57
5.4.30.0070.06716.38
5.4.20.0130.04716.46
5.4.10.0130.07016.46
5.4.00.0170.04715.71
5.3.290.0090.03712.80
5.3.280.0070.05314.52
5.3.270.0030.06714.49
5.3.260.0130.05014.47
5.3.250.0000.06314.32
5.3.240.0200.06014.63
5.3.230.0100.05714.62
5.3.220.0030.06014.43
5.3.210.0100.05314.59
5.3.200.0030.05314.63
5.3.190.0100.07314.59
5.3.180.0130.05714.48
5.3.170.0200.06314.43
5.3.160.0070.05014.66
5.3.150.0000.06314.34
5.3.140.0130.04314.56
5.3.130.0070.07014.55
5.3.120.0130.07014.60
5.3.110.0170.06314.57
5.3.100.0130.07313.82
5.3.90.0070.05313.95
5.3.80.0070.07014.18
5.3.70.0070.05014.12
5.3.60.0100.05313.95
5.3.50.0100.05014.11
5.3.40.0030.05313.98
5.3.30.0030.05313.79
5.3.20.0330.03713.40
5.3.10.0030.06013.70
5.3.00.0070.05313.64
5.2.170.0030.04310.92
5.2.160.0030.06311.05
5.2.150.0100.05311.16
5.2.140.0070.05311.17
5.2.130.0070.05311.05
5.2.120.0100.03711.00
5.2.110.0130.04011.00
5.2.100.0030.04010.86
5.2.90.0130.04711.13
5.2.80.0230.04311.25
5.2.70.0070.04311.12
5.2.60.0100.05711.08
5.2.50.0000.07010.92
5.2.40.0070.05711.03
5.2.30.0130.05311.00
5.2.20.0130.04710.89
5.2.10.0130.03710.76
5.2.00.0170.04710.65
5.1.60.0070.03310.07
5.1.50.0070.04710.10
5.1.40.0030.0439.89
5.1.30.0130.04010.52
5.1.20.0100.03710.46
5.1.10.0000.04010.17
5.1.00.0070.04310.23
5.0.50.0000.0308.49
5.0.40.0070.0278.66
5.0.30.0000.0478.27
5.0.20.0070.0308.28
5.0.10.0070.0378.23
5.0.00.0070.0538.14
4.4.90.0030.0336.15
4.4.80.0000.0276.15
4.4.70.0000.0276.15
4.4.60.0070.0236.15
4.4.50.0070.0276.15
4.4.40.0000.0536.15
4.4.30.0030.0306.15
4.4.20.0000.0276.15
4.4.10.0000.0276.15
4.4.00.0070.0336.15
4.3.110.0000.0276.15
4.3.100.0100.0236.15
4.3.90.0030.0306.15
4.3.80.0030.0336.15
4.3.70.0030.0306.15
4.3.60.0070.0236.15
4.3.50.0130.0206.15
4.3.40.0070.0406.15
4.3.30.0070.0236.15
4.3.20.0030.0336.15
4.3.10.0100.0206.15
4.3.00.0130.0176.36

preferences:
41.37 ms | 401 KiB | 5 Q