3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); echo 'Here is __DIR__ to start: ' . "\n"; var_dump(__DIR__); echo "\n"; echo 'Checking if __DIR__ is defined...' . "\n"; if (!defined('__DIR__')) { echo 'Nope, defined() returned (bool)false.' . "\n"; echo 'No prob. Executing define(\'__DIR__\', \'/foo/bar\')...' . "\n"; define('__DIR__', '/foo/bar'); echo 'Done, defined __DIR__ as "/foo/bar".' . "\n" . "\n"; echo 'Double-checking __DIR__ is defined now...' . "\n"; if (!defined('__DIR__')) { echo 'WTF, defined(\'__DIR__\') again returned (bool)false?!' . "\n"; } else{ echo 'Strike, this time defined(\'__DIR__\') returned (bool)true.' . "\n"; } } else{ echo 'Yep, defined(\'__DIR__\') returned (bool)true.' . "\n"; } echo 'Finally, here is the result of var_dump(__DIR__):' . "\n"; 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.0100.01018.31
8.3.50.0070.01221.27
8.3.40.0030.01218.70
8.3.30.0000.01420.17
8.3.20.0040.00418.64
8.3.10.0060.00320.92
8.3.00.0040.00423.48
8.2.180.0170.00318.16
8.2.170.0110.00422.96
8.2.160.0120.00320.41
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0040.00419.53
8.2.110.0060.00322.13
8.2.100.0080.00317.72
8.2.90.0040.00419.08
8.2.80.0000.00817.97
8.2.70.0040.00417.38
8.2.60.0080.00017.92
8.2.50.0000.00818.10
8.2.40.0030.00618.22
8.2.30.0090.00019.37
8.2.20.0030.00517.74
8.2.10.0030.00517.53
8.2.00.0080.00017.68
8.1.270.0000.00723.99
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0090.00020.66
8.1.230.0060.00617.82
8.1.220.0030.00617.74
8.1.210.0080.00018.77
8.1.200.0040.00417.35
8.1.190.0050.00317.23
8.1.180.0080.00018.10
8.1.170.0040.00418.66
8.1.160.0050.00218.80
8.1.150.0080.00018.62
8.1.140.0050.00317.28
8.1.130.0070.00017.68
8.1.120.0030.00417.42
8.1.110.0040.00417.36
8.1.100.0000.00717.39
8.1.90.0000.00717.39
8.1.80.0030.00317.31
8.1.70.0040.00417.36
8.1.60.0040.00417.51
8.1.50.0030.00617.50
8.1.40.0020.00517.47
8.1.30.0000.00717.63
8.1.20.0050.00317.52
8.1.10.0000.00717.34
8.1.00.0040.00417.29
8.0.300.0000.01018.77
8.0.290.0040.00416.63
8.0.280.0000.00718.47
8.0.270.0030.00317.13
8.0.260.0060.00016.82
8.0.250.0000.00716.93
8.0.240.0000.00816.86
8.0.230.0000.00716.79
8.0.220.0050.00316.88
8.0.210.0060.00316.84
8.0.200.0050.00216.90
8.0.190.0000.00716.84
8.0.180.0040.00716.71
8.0.170.0070.00016.85
8.0.160.0000.00716.76
8.0.150.0030.00416.88
8.0.140.0000.00816.87
8.0.130.0050.00013.24
8.0.120.0040.00416.71
8.0.110.0080.00016.88
8.0.100.0050.00316.74
8.0.90.0000.00716.88
8.0.80.0030.01216.73
8.0.70.0020.00516.82
8.0.60.0000.00816.85
8.0.50.0040.00416.72
8.0.30.0120.00717.01
8.0.20.0120.00617.40
8.0.10.0000.00816.85
8.0.00.0110.00816.68
7.4.330.0000.00416.71
7.4.320.0000.00616.38
7.4.300.0050.00216.45
7.4.290.0100.00516.45
7.4.280.0030.00316.46
7.4.270.0070.00016.48
7.4.260.0000.00613.34
7.4.250.0040.00416.37
7.4.240.0030.00316.52
7.4.230.0030.00316.45
7.4.220.0070.01116.43
7.4.210.0110.00616.51
7.4.200.0000.00716.51
7.4.190.0000.00716.55
7.4.160.0170.00016.59
7.4.150.0200.00617.40
7.4.140.0080.00917.86
7.4.130.0050.01516.45
7.4.120.0120.00716.45
7.4.110.0100.01016.39
7.4.100.0160.00716.29
7.4.90.0080.00816.44
7.4.80.0030.01219.39
7.4.70.0070.01116.42
7.4.60.0060.01516.47
7.4.50.0050.00316.35
7.4.40.0060.00922.77
7.4.30.0110.01016.42
7.4.00.0100.00715.16
7.3.330.0020.00213.00
7.3.320.0050.00313.07
7.3.310.0000.00716.14
7.3.300.0060.00016.02
7.3.290.0040.01116.11
7.3.280.0080.00816.15
7.3.270.0090.00917.40
7.3.260.0120.00818.24
7.3.250.0130.00516.37
7.3.240.0090.00616.35
7.3.230.0160.00316.39
7.3.210.0070.01016.28
7.3.200.0070.01119.39
7.3.190.0040.01316.31
7.3.180.0120.00616.22
7.3.170.0080.00816.27
7.3.160.0030.01516.40
7.3.120.0090.00614.53
7.2.330.0120.00616.65
7.2.320.0160.00616.53
7.2.310.0080.00816.63
7.2.300.0080.00816.46
7.2.290.0080.00816.46
7.2.00.0030.01019.01
7.1.100.0030.00818.27
7.1.70.0000.01517.03
7.1.60.0100.01319.17
7.1.50.0070.01016.93
7.1.00.0000.03722.47
7.0.200.0030.00716.73
7.0.140.0170.06021.97
7.0.80.0030.07319.92
7.0.70.0070.07719.90
7.0.60.0470.05319.86
7.0.50.0430.07320.21
7.0.40.0070.08720.13
7.0.30.0130.08320.11
7.0.20.0030.05320.00
7.0.10.0030.07020.03
7.0.00.0030.04720.09
5.6.280.0000.07721.08
5.6.230.0070.04020.59
5.6.220.0070.06720.48
5.6.210.0030.05720.64
5.6.200.0130.08021.10
5.6.190.0100.08320.95
5.6.180.0170.07021.00
5.6.170.0170.07021.04
5.6.160.0070.04020.93
5.6.150.0030.06021.13
5.6.140.0030.08321.04
5.6.130.0070.05021.05
5.6.120.0070.09021.01
5.6.110.0070.06020.92
5.6.100.0170.03320.94
5.6.90.0030.04721.05
5.6.80.0030.04020.43
5.6.70.0170.06720.43
5.6.60.0130.06320.48
5.6.50.0070.07020.29
5.6.40.0030.04720.45
5.6.30.0070.08320.32
5.6.20.0100.04720.37
5.6.10.0030.06020.43
5.6.00.0070.07320.36
5.5.370.0170.04720.54
5.5.360.0100.08020.33
5.5.350.0100.04720.49
5.5.340.0130.06320.83
5.5.330.0130.07720.80
5.5.320.0170.03020.90
5.5.310.0070.08320.86
5.5.300.0170.07020.82
5.5.290.0030.08720.91
5.5.280.0100.07020.80
5.5.270.0100.07320.90
5.5.260.0100.08020.82
5.5.250.0170.05720.59
5.5.240.0130.06020.21
5.5.230.0030.07720.27
5.5.220.0070.04020.23
5.5.210.0070.08320.30
5.5.200.0130.05020.13
5.5.190.0130.06720.25
5.5.180.0000.06320.11
5.5.160.0100.07719.99
5.5.150.0100.07320.14
5.5.140.0030.06020.25
5.5.130.0030.04720.14
5.5.120.0170.07020.08
5.5.110.0070.04020.21
5.5.100.0070.06319.98
5.5.90.0030.08320.09
5.5.80.0070.08020.12
5.5.70.0070.05720.05
5.5.60.0070.07720.03
5.5.50.0070.03319.96
5.5.40.0070.07320.05
5.5.30.0100.05320.02
5.5.20.0070.03320.05
5.5.10.0030.08019.95
5.5.00.0000.04020.05
5.4.450.0130.08019.25
5.4.440.0100.05319.31
5.4.430.0030.08319.30
5.4.420.0130.06319.37
5.4.410.0070.05019.11
5.4.400.0030.05019.10
5.4.390.0130.06318.96
5.4.380.0200.06019.11
5.4.370.0100.07319.03
5.4.360.0100.07318.98
5.4.350.0100.04319.03
5.4.340.0100.04718.95
5.4.320.0100.06019.07
5.4.310.0100.07719.13
5.4.300.0130.03718.75
5.4.290.0100.07319.05
5.4.280.0070.07318.96
5.4.270.0100.07019.04
5.4.260.0100.03019.12
5.4.250.0070.07019.11
5.4.240.0000.05019.09
5.4.230.0030.03719.11
5.4.220.0030.07719.08
5.4.210.0000.08318.96
5.4.200.0070.06319.04
5.4.190.0030.05019.11
5.4.180.0070.03319.04
5.4.170.0000.08018.89
5.4.160.0000.07019.00
5.4.150.0030.05718.96
5.4.140.0000.04716.27
5.4.130.0070.06716.37
5.4.120.0000.04016.27
5.4.110.0030.07016.30
5.4.100.0070.06316.18
5.4.90.0000.05716.30
5.4.80.0030.07316.36
5.4.70.0100.06716.22
5.4.60.0000.03716.20
5.4.50.0030.07316.18
5.4.40.0000.05716.36
5.4.30.0030.05316.18
5.4.20.0030.04716.19
5.4.10.0100.07016.21
5.4.00.0130.05715.73
5.3.290.0070.04314.67
5.3.280.0030.03714.45
5.3.270.0000.07014.56
5.3.260.0100.07314.57
5.3.250.0030.04314.44
5.3.240.0030.03314.59
5.3.230.0070.06014.59
5.3.220.0130.05014.39
5.3.210.0100.03014.50
5.3.200.0100.03014.55
5.3.190.0030.04014.41
5.3.180.0070.05014.38
5.3.170.0100.03014.42
5.3.160.0000.07714.55
5.3.150.0030.03314.52
5.3.140.0030.07714.54
5.3.130.0000.05014.41
5.3.120.0000.08014.53
5.3.110.0070.07314.54
5.3.100.0070.07713.91
5.3.90.0000.08313.99
5.3.80.0030.07713.95
5.3.70.0100.05714.00
5.3.60.0070.04713.86
5.3.50.0030.08013.71
5.3.40.0100.05713.80
5.3.30.0100.06713.66
5.3.20.0030.07013.68
5.3.10.0030.06313.64
5.3.00.0030.04713.51
5.2.170.0070.05311.67
5.2.160.0070.06011.67
5.2.150.0030.06011.67
5.2.140.0030.03711.67
5.2.130.0000.05011.67
5.2.120.0070.06011.67
5.2.110.0070.05711.67
5.2.100.0000.03011.67
5.2.90.0070.05711.67
5.2.80.0030.05711.67
5.2.70.0130.04011.67
5.2.60.0030.06011.67
5.2.50.0070.05711.67
5.2.40.0030.04311.67
5.2.30.0070.06011.67
5.2.20.0070.05011.67
5.2.10.0030.04311.67
5.2.00.0130.05011.67
5.1.60.0100.05711.67
5.1.50.0070.05011.67
5.1.40.0070.04711.67
5.1.30.0070.05311.67
5.1.20.0100.05011.67
5.1.10.0070.05311.67
5.1.00.0130.04311.67
5.0.50.0070.04011.67
5.0.40.0030.04011.67
5.0.30.0100.05711.67
5.0.20.0000.04711.67
5.0.10.0000.02311.67
5.0.00.0100.04311.67
4.4.90.0070.02711.67
4.4.80.0030.03311.67
4.4.70.0030.03711.67
4.4.60.0030.02711.67
4.4.50.0030.02311.67
4.4.40.0030.05311.67
4.4.30.0000.04011.67
4.4.20.0070.02011.67
4.4.10.0030.03311.67
4.4.00.0030.05311.67
4.3.110.0070.01311.67
4.3.100.0000.04011.67
4.3.90.0000.01711.67
4.3.80.0000.02711.67
4.3.70.0000.01711.67
4.3.60.0000.01711.67
4.3.50.0070.02011.67
4.3.40.0000.02311.67
4.3.30.0000.01711.67
4.3.20.0030.03311.67
4.3.10.0070.03011.67
4.3.00.0030.01711.67

preferences:
59.43 ms | 400 KiB | 5 Q