3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); echo 'Testing on PHP version ' . PHP_VERSION . PHP_EOL . PHP_EOL; sleep(1); echo 'Checking if `__DIR__` is defined...' . PHP_EOL; if (!defined('__DIR__')) { sleep(2); echo 'Nope, `defined()` returned `(bool)false`.' . PHP_EOL; echo 'So, seems like the magic constant `__DIR__` is not defined.' . PHP_EOL . PHP_EOL; sleep(2); echo 'No prob. Executing `define(\'__DIR__\', \'/foo/bar\')`...' . PHP_EOL; define('__DIR__', '/foo/bar'); sleep(1); echo 'Done, defined `__DIR__` as "/foo/bar".' . PHP_EOL . PHP_EOL; sleep(1); echo 'Double-checking `__DIR__` is defined now...' . PHP_EOL; sleep(2); if (!defined('__DIR__')) { echo 'WTF, `defined(\'__DIR__\')` again returned `(bool)false`?!' . PHP_EOL; } else{ echo 'Strike, this time `defined(\'__DIR__\')` returned `(bool)true`.' . PHP_EOL; echo 'So, seems like `__DIR__` was successfully defined. :)' . PHP_EOL . PHP_EOL; } } else{ echo 'Yep, `defined(\'__DIR__\')` returned `(bool)true`.' . PHP_EOL; echo 'The magic constant `__DIR__` seems to be defined.' . PHP_EOL . PHP_EOL; } sleep(2); echo 'Finally, here is the result of `var_dump(__DIR__)`:' . PHP_EOL; var_dump(__DIR__);

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.0170.00318.18
8.3.50.0100.00722.05
8.3.40.0100.01018.71
8.3.30.0090.00618.72
8.3.20.0030.00618.82
8.3.10.0030.00620.98
8.3.00.0030.00521.65
8.2.180.0120.00816.50
8.2.170.0060.00922.96
8.2.160.0080.00520.53
8.2.150.0090.00024.18
8.2.140.0030.00624.66
8.2.130.0000.00926.16
8.2.120.0040.00421.04
8.2.110.0070.00420.38
8.2.100.0120.00017.72
8.2.90.0040.00419.09
8.2.80.0000.00817.97
8.2.70.0080.00017.50
8.2.60.0000.00717.93
8.2.50.0040.00418.07
8.2.40.0070.00018.22
8.2.30.0040.00421.22
8.2.20.0040.00417.59
8.2.10.0030.00517.71
8.2.00.0040.00617.57
8.1.280.0100.00725.92
8.1.270.0090.00024.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00322.47
8.1.230.0080.00320.82
8.1.220.0020.00518.77
8.1.210.0040.00418.96
8.1.200.0050.00317.22
8.1.190.0060.00217.16
8.1.180.0080.00018.10
8.1.170.0000.00718.41
8.1.160.0020.00518.96
8.1.150.0070.00018.70
8.1.140.0020.00517.41
8.1.130.0070.00017.83
8.1.120.0030.00517.48
8.1.110.0020.00517.38
8.1.100.0000.00717.46
8.1.90.0030.00317.46
8.1.80.0020.00517.46
8.1.70.0040.00417.39
8.1.60.0030.00617.59
8.1.50.0070.00017.39
8.1.40.0030.00517.56
8.1.30.0070.00017.61
8.1.20.0000.00817.49
8.1.10.0050.00317.40
8.1.00.0010.00617.46
8.0.300.0060.00319.86
8.0.290.0050.00217.05
8.0.280.0070.00018.33
8.0.270.0030.00317.09
8.0.260.0040.00216.71
8.0.250.0000.00916.70
8.0.240.0040.00416.77
8.0.230.0000.00716.77
8.0.220.0030.00516.63
8.0.210.0030.00316.83
8.0.200.0060.00016.80
8.0.190.0070.00016.75
8.0.180.0040.00416.80
8.0.170.0060.00316.90
8.0.160.0020.00516.78
8.0.150.0030.00616.72
8.0.140.0080.00016.71
8.0.130.0000.00613.26
8.0.120.0040.00416.73
8.0.110.0050.00216.68
8.0.100.0000.00716.54
8.0.90.0040.00416.59
8.0.80.0100.00616.63
8.0.70.0080.00016.71
8.0.60.0040.00416.79
8.0.50.0000.00716.62
8.0.30.0160.00816.85
8.0.20.0080.01017.40
8.0.10.0000.00816.74
8.0.00.0080.00916.54
7.4.330.0030.00316.84
7.4.320.0050.00216.46
7.4.300.0000.00616.25
7.4.290.0070.00016.45
7.4.280.0050.00316.33
7.4.270.0080.00016.38
7.4.260.0020.00413.25
7.4.250.0030.00516.25
7.4.240.0000.00716.31
7.4.230.0070.00016.31
7.4.220.0120.00316.27
7.4.210.0080.00716.35
7.4.200.0020.00516.39
7.4.190.0070.00016.50
7.4.160.0170.00616.36
7.4.150.0100.00717.40
7.4.140.0090.01017.86
7.4.130.0150.00516.25
7.4.120.0070.01016.35
7.4.110.0080.00816.34
7.4.100.0040.01216.29
7.4.90.0060.01716.36
7.4.80.0100.00719.39
7.4.70.0000.01716.29
7.4.60.0110.00616.30
7.4.50.0000.00816.34
7.4.40.0070.01122.77
7.4.30.0060.01016.16
7.3.330.0060.00012.95
7.3.320.0030.00313.05
7.3.310.0070.00016.08
7.3.300.0040.00415.87
7.3.290.0090.00516.06
7.3.280.0060.00815.99
7.3.270.0110.00617.40
7.3.260.0140.00818.24
7.3.250.0120.00516.04
7.3.240.0080.00816.29
7.3.230.0110.00616.39
7.3.210.0060.00916.10
7.3.200.0100.00719.39
7.3.190.0060.01116.16
7.3.180.0120.00316.05
7.3.170.0150.00616.27
7.3.160.0090.00916.16
7.2.330.0200.00016.50
7.2.320.0090.01116.52
7.2.310.0110.00716.66
7.2.300.0040.01116.41
7.2.290.0090.00816.53
7.2.100.0580.00314.59
7.1.220.0450.01013.66
7.1.210.0460.00013.56
5.6.380.0100.01214.23

preferences:
50.41 ms | 401 KiB | 5 Q