3v4l.org

run code in 300+ PHP versions simultaneously
<?php function var_types() { $bt = debug_backtrace()[0]; $file = new \SPLFileObject($bt['file']); $file->seek($bt['line'] - 1); $line = $file->current(); $matchs = null; preg_match('/var_types\((.*)\)/', $line, $matchs); $param_names = array_map('trim', explode(",", $matchs[1])); $args = func_get_args(); for ($i = 0; $i < count($args); $i++) { echo $param_names[$i] . ' ' . gettype($args[$i]) . PHP_EOL; } } define('MY_CONSTANT', 1); $string = "STR"; $num = 123.4; var_types(MY_CONSTANT, $string, $num, $_GET, $_SERVER['PHP_SELF']);

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.4.60.0120.00720.86
8.4.50.0130.00719.76
8.4.40.0140.00719.45
8.4.30.0090.01217.57
8.4.20.0090.00617.78
8.4.10.0060.00619.60
8.3.200.0040.00516.57
8.3.190.0140.00719.18
8.3.180.0050.01416.82
8.3.170.0180.00017.48
8.3.160.0070.01118.50
8.3.150.0110.00419.02
8.3.140.0120.00318.53
8.3.130.0040.01116.71
8.3.120.0130.00718.97
8.3.110.0160.00320.94
8.3.100.0050.00524.06
8.3.90.0150.00326.77
8.3.80.0060.00318.65
8.3.70.0040.01116.86
8.3.60.0150.00018.55
8.3.50.0110.01023.07
8.3.40.0090.00618.92
8.3.30.0090.00619.09
8.3.20.0050.00321.84
8.3.10.0040.00420.34
8.3.00.0040.00719.79
8.2.280.0050.00318.54
8.2.270.0070.01317.27
8.2.260.0140.00318.49
8.2.250.0030.00618.47
8.2.240.0000.01118.93
8.2.230.0000.00822.58
8.2.220.0110.00737.54
8.2.210.0080.00026.77
8.2.200.0090.00018.54
8.2.190.0060.00916.63
8.2.180.0110.01118.79
8.2.170.0070.01122.96
8.2.160.0100.00320.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00018.09
8.2.120.0040.00426.35
8.2.110.0090.00019.05
8.2.100.0060.00618.03
8.2.90.0050.00319.36
8.2.80.0000.00817.97
8.2.70.0050.00317.86
8.2.60.0050.00318.05
8.2.50.0000.00918.10
8.2.40.0080.00020.45
8.2.30.0000.00719.54
8.2.20.0040.00418.28
8.2.10.0020.00518.35
8.2.00.0000.00717.88
8.1.320.0160.00516.44
8.1.310.0030.00618.52
8.1.300.0030.00520.45
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0050.00321.98
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.97
8.1.230.0000.01117.95
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0050.01017.34
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0030.00518.63
8.1.160.0040.00418.98
8.1.150.0000.00721.96
8.1.140.0040.00419.61
8.1.130.0080.00018.94
8.1.120.0000.00817.57
8.1.110.0000.00717.53
8.1.100.0000.00717.54
8.1.90.0040.00717.69
8.1.80.0040.00417.68
8.1.70.0000.00717.48
8.1.60.0040.00417.76
8.1.50.0040.00417.68
8.1.40.0030.00617.72
8.1.30.0070.00417.70
8.1.20.0000.00817.65
8.1.10.0000.00717.63
8.1.00.0000.00817.62
8.0.300.0040.00418.77
8.0.290.0050.00317.00
8.0.280.0000.00718.39
8.0.270.0000.00716.87
8.0.260.0030.00317.21
8.0.250.0000.00717.18
8.0.240.0030.00517.15
8.0.230.0080.00017.19
8.0.220.0000.00717.04
8.0.210.0030.00316.96
8.0.200.0050.00317.17
8.0.190.0040.00417.04
8.0.180.0000.00717.01
8.0.170.0040.00417.11
8.0.160.0040.00417.05
8.0.150.0050.00316.96
8.0.140.0030.00317.04
8.0.130.0000.00513.50
8.0.120.0040.00417.05
8.0.110.0050.00316.93
8.0.100.0040.00417.05
8.0.90.0050.00317.13
8.0.80.0070.01117.00
8.0.70.0000.00916.96
8.0.60.0000.00817.18
8.0.50.0000.00817.10
8.0.30.0100.00817.20
8.0.20.0110.00817.40
8.0.10.0070.00017.23
8.0.00.0090.00917.16
7.4.330.0050.00015.55
7.4.320.0030.00316.88
7.4.300.0030.00316.76
7.4.290.0030.00316.76
7.4.280.0030.00516.73
7.4.270.0000.00716.88
7.4.260.0070.00016.69
7.4.250.0050.00316.61
7.4.240.0040.00316.83
7.4.230.0040.00316.63
7.4.220.0090.01016.65
7.4.210.0070.01216.77
7.4.200.0040.00416.86
7.4.160.0110.00516.54
7.4.150.0090.00917.40
7.4.140.0060.01317.86
7.4.130.0080.00916.77
7.4.120.0120.00516.66
7.4.110.0100.01416.61
7.4.100.0090.01616.72
7.4.90.0090.01316.81
7.4.80.0000.01519.39
7.4.70.0090.00916.82
7.4.60.0100.00616.74
7.4.50.0030.01216.34
7.4.40.0100.00716.73
7.4.30.0050.01116.77
7.4.00.0040.01415.04
7.3.330.0000.00513.35
7.3.320.0030.00313.55
7.3.310.0000.00716.44
7.3.300.0030.00316.42
7.3.290.0080.00916.53
7.3.280.0080.00816.54
7.3.270.0070.01117.40
7.3.260.0100.00816.68
7.3.250.0090.01016.53
7.3.240.0080.01416.74
7.3.230.0100.01016.78
7.3.210.0100.00716.62
7.3.200.0130.01016.78
7.3.190.0140.00316.72
7.3.180.0100.00616.86
7.3.170.0070.01116.96
7.3.160.0060.01016.53
7.2.330.0180.00017.01
7.2.320.0130.01017.09
7.2.310.0080.00916.88
7.2.300.0090.01516.89
7.2.290.0170.00716.84
7.2.60.0100.00317.10
7.2.30.0150.01317.87
7.2.20.0150.01517.98
7.2.10.0190.01318.28
7.2.00.0150.01218.06
7.1.200.0150.01115.79
7.1.150.0140.01017.02
7.1.140.0150.01317.00
7.1.130.1810.01417.22
7.1.120.0140.01216.82
7.1.110.0130.00816.46
7.1.100.0100.01316.48
7.1.90.0120.01416.44
7.1.80.0110.01215.93
7.1.70.0050.01316.48
7.1.60.0180.01125.28
7.1.50.0310.01732.81
7.1.40.0360.01932.57
7.1.30.0290.01032.46
7.1.20.0320.01532.60
7.1.10.0120.04618.71
7.1.00.0090.03818.74
7.0.270.0140.01216.30
7.0.260.0120.01316.76
7.0.250.0160.00816.14
7.0.240.0120.01216.11
7.0.230.0140.01415.93
7.0.220.0180.01216.08
7.0.210.0140.00914.93
7.0.200.0140.01416.07
7.0.190.0110.01015.05
7.0.180.0140.01014.64
7.0.170.0100.01114.64
7.0.160.0140.01114.57
7.0.150.0110.04218.35
7.0.140.0110.04118.38
7.0.130.0130.03618.42
7.0.120.1390.04818.39
7.0.110.0080.04518.31
7.0.100.0170.03118.30
7.0.90.0080.04018.36
7.0.80.0110.04018.32
7.0.70.0130.03518.36
7.0.60.0150.03318.15
7.0.50.0090.03618.31
7.0.40.0120.03318.31
7.0.30.0130.03418.43
7.0.20.0130.03918.40
7.0.10.0130.03218.38
7.0.00.0100.03318.30

preferences:
29.66 ms | 403 KiB | 5 Q