3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(php_uname('s')); $base_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR; file_put_contents($base_dir . 'Baz.php', "<?php namespace Foo\Bar; class BAZ {}"); file_put_contents($base_dir . 'Buz.php', "<?php namespace Foo\Bar; class Buz {}"); require_once 'https://raw.github.com/php-fig/fig-standards/master/accepted/PSR-4-autoloader-examples.md'; // spl_autoload_register(function ($class) { // // project-specific namespace prefix // $prefix = 'Foo\\Bar\\'; // // base directory for the namespace prefix // global $base_dir; # = __DIR__ . '/src/'; // // does the class use the namespace prefix? // $len = strlen($prefix); // if (strncmp($prefix, $class, $len) !== 0) { // // no, move to the next registered autoloader // return; // } // // get the relative class name // $relative_class = substr($class, $len); // // replace the namespace prefix with the base directory, replace namespace // // separators with directory separators in the relative class name, append // // with .php // $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; // // if the file exists, require it // if (file_exists($file)) { // require $file; // } // }); $c1 = new \Foo\Bar\Baz(); $c2 = new \Foo\Bar\BAZ(); var_dump($c1 == $c2); $c3 = new \Foo\Bar\BUZ(); $c4 = new \Foo\Bar\Buz(); var_dump($c3 == $c4);

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.00718.43
8.3.50.0070.01221.14
8.3.40.0150.00319.01
8.3.30.0040.01120.13
8.3.20.0050.00318.95
8.3.10.0080.00021.07
8.3.00.0060.00322.57
8.2.180.0040.01417.00
8.2.170.0110.00422.96
8.2.160.0040.01120.52
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0070.00026.16
8.2.120.0050.00321.12
8.2.110.0060.00322.07
8.2.100.0040.00817.71
8.2.90.0080.00019.09
8.2.80.0030.00617.97
8.2.70.0060.00617.50
8.2.60.0080.00018.05
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0080.00019.86
8.2.20.0050.00317.79
8.2.10.0000.00917.79
8.2.00.0000.00817.79
8.1.280.0070.01125.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0130.00722.50
8.1.230.0110.00020.84
8.1.220.0060.00318.77
8.1.210.0000.00818.97
8.1.200.0090.00917.13
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0000.00818.56
8.1.160.0050.00218.94
8.1.150.0040.00418.68
8.1.140.0070.00017.41
8.1.130.0080.00017.87
8.1.120.0030.00517.50
8.1.110.0030.00517.32
8.1.100.0000.00817.39
8.1.90.0070.00017.46
8.1.80.0080.00017.48
8.1.70.0040.00417.48
8.1.60.0080.00017.52
8.1.50.0040.00417.58
8.1.40.0030.00517.66
8.1.30.0030.00517.61
8.1.20.0060.00317.74
8.1.10.0000.00917.73
8.1.00.0040.00417.55
8.0.300.0030.00620.29
8.0.290.0060.00317.00
8.0.280.0000.00918.52
8.0.270.0000.00817.38
8.0.260.0040.00417.04
8.0.250.0040.00417.14
8.0.240.0000.00917.12
8.0.230.0070.00017.03
8.0.220.0000.00716.98
8.0.210.0040.00417.07
8.0.200.0000.00717.09
8.0.190.0000.00816.98
8.0.180.0000.00717.13
8.0.170.0000.00916.94
8.0.160.0000.00716.97
8.0.150.0000.00717.05
8.0.140.0030.00517.03
8.0.130.0030.00313.45
8.0.120.0000.00717.02
8.0.110.0040.00416.89
8.0.100.0040.00416.95
8.0.90.0040.00417.02
8.0.80.0060.00917.07
8.0.70.0000.00817.13
8.0.60.0000.00717.02
8.0.50.0040.00417.10
8.0.30.0090.01417.17
8.0.20.0140.00517.40
8.0.10.0040.00417.06
8.0.00.0100.01117.01
7.4.330.0020.00216.84
7.4.320.0000.00616.69
7.4.300.0030.00316.52
7.4.290.0030.00316.62
7.4.280.0000.00716.45
7.4.270.0050.00216.65
7.4.260.0030.00313.29
7.4.250.0000.00816.51
7.4.240.0040.00416.65
7.4.230.0030.00316.48
7.4.220.0030.01716.51
7.4.210.0050.01216.69
7.4.200.0030.00316.55
7.4.190.0000.00716.73
7.4.160.0060.01016.37
7.4.150.0060.01217.40
7.4.140.0130.00817.86
7.4.130.0120.00816.49
7.4.120.0030.01516.63
7.4.110.0110.00716.46
7.4.100.0030.02016.43
7.4.90.0160.00316.59
7.4.80.0140.00519.39
7.4.70.0130.00416.54
7.4.60.0120.00916.59
7.4.50.0090.00016.70
7.4.40.0070.00722.77
7.4.30.0190.00316.54
7.4.10.0060.01214.77
7.4.00.0090.00915.19
7.3.330.0030.00313.26
7.3.320.0040.00413.26
7.3.310.0000.00716.51
7.3.300.0030.00616.47
7.3.290.0080.00816.41
7.3.280.0110.00716.45
7.3.270.0040.01417.40
7.3.260.0110.01018.24
7.3.250.0150.00716.49
7.3.240.0060.01816.66
7.3.230.0120.00916.56
7.3.210.0090.00916.58
7.3.200.0120.00919.39
7.3.190.0090.00916.56
7.3.180.0130.00316.40
7.3.170.0040.01216.60
7.3.160.0100.00616.48
7.3.130.0030.01214.93
7.3.120.0040.01314.79
7.3.110.0030.01314.93
7.3.100.0030.00914.76
7.3.90.0080.00414.62
7.3.80.0030.01014.87
7.3.70.0060.01014.70
7.3.60.0030.01014.57
7.3.50.0040.00414.80
7.3.40.0060.00314.64
7.3.30.0000.01214.87
7.3.20.0130.00016.81
7.3.10.0140.00016.69
7.3.00.0050.00716.72
7.2.330.0090.00916.39
7.2.320.0080.01616.64
7.2.310.0120.01216.84
7.2.300.0140.00716.66
7.2.290.0060.01116.63
7.2.260.0070.01014.93
7.2.250.0110.00315.13
7.2.240.0090.00615.24
7.2.230.0060.00815.20
7.2.220.0070.01015.21
7.2.210.0030.01014.94
7.2.200.0090.00615.07
7.2.190.0030.01214.95
7.2.180.0070.00715.02
7.2.170.0060.00915.14
7.2.160.0100.00714.93
7.2.150.0070.01016.81
7.2.140.0100.00316.91
7.2.130.0090.00416.78
7.2.120.0050.00616.81
7.2.110.0060.00816.91
7.2.100.0050.00916.91
7.2.90.0060.00517.00
7.2.80.0020.01116.59
7.2.70.0070.00516.84
7.2.60.0060.00816.84
7.2.50.0060.00816.75
7.2.40.0090.00516.98
7.2.30.0050.00916.95
7.2.20.0020.01016.80
7.2.10.0080.00616.61
7.2.00.0110.00717.72
7.1.330.0040.01115.87
7.1.320.0060.00315.71
7.1.310.0040.00815.74
7.1.300.0030.00615.64
7.1.290.0040.00815.96
7.1.280.0110.00015.89
7.1.270.0030.01215.79
7.1.260.0030.00615.92
7.1.250.0050.00515.71
7.1.240.0050.00715.71
7.1.230.0090.00415.61
7.1.220.0090.00715.82
7.1.210.0110.00315.69
7.1.200.0050.01015.67
7.1.190.0020.01015.79
7.1.180.0060.00615.71
7.1.170.0060.00515.75
7.1.160.0040.00815.73
7.1.150.0090.00415.79
7.1.140.0080.00315.83
7.1.130.0110.00315.71
7.1.120.0030.00615.63
7.1.110.0110.00315.76
7.1.100.0090.00816.32
7.1.90.0050.00715.84
7.1.80.0050.01115.80
7.1.70.0070.00416.24
7.1.60.0070.00816.90
7.1.50.0110.00816.04
7.1.40.0060.00815.70
7.1.30.0100.00315.65
7.1.20.0070.00515.70
7.1.10.0130.00515.55
7.1.00.0040.02117.94
7.0.330.0030.00815.30
7.0.320.0030.00815.45
7.0.310.0050.00815.40
7.0.300.0030.00915.40
7.0.290.0080.00515.33
7.0.280.0060.00715.29
7.0.270.0070.00815.37
7.0.260.0030.00815.25
7.0.250.0020.01315.47
7.0.240.0090.00415.49
7.0.230.0070.00715.39
7.0.220.0040.00915.38
7.0.210.0050.00815.32
7.0.200.0070.00515.89
7.0.190.0060.00615.22
7.0.180.0050.00915.22
7.0.170.0070.00515.44
7.0.160.0080.00815.12
7.0.150.0110.00515.26
7.0.140.0060.02917.62
7.0.130.0010.01215.22
7.0.120.0080.00515.28
7.0.110.0050.00715.29
7.0.100.0050.00515.44
7.0.90.0050.00715.38
7.0.80.0050.00715.46
7.0.70.0070.03317.56
7.0.60.0040.02717.47
7.0.50.0020.03617.69
7.0.40.0030.03215.64
7.0.30.0140.02315.66
7.0.20.0060.03015.54
7.0.10.0040.03415.62
7.0.00.0090.02915.62
5.6.400.0120.00014.25
5.6.390.0100.00314.51
5.6.380.0080.00114.35
5.6.370.0070.00414.14
5.6.360.0040.00714.29
5.6.350.0050.00714.30
5.6.340.0030.00914.28
5.6.330.0070.00514.09
5.6.320.0050.00814.11
5.6.310.0050.00914.21
5.6.300.0090.00714.33
5.6.290.0080.00514.06
5.6.280.0080.00714.25
5.6.270.0070.00814.05
5.6.260.0020.01214.18
5.6.250.0030.01014.32
5.6.240.0090.00414.46
5.6.230.0050.00914.22
5.6.220.0040.03516.40
5.6.210.0030.03116.30
5.6.200.0060.03016.47
5.6.190.0050.03016.48
5.6.180.0050.02816.40
5.6.170.0040.03716.39
5.6.160.0070.03416.55
5.6.150.0060.03616.47
5.6.140.0040.03316.45
5.6.130.0070.03316.46
5.6.120.0060.02116.50
5.6.110.0100.01416.36
5.6.100.0040.03716.49
5.6.90.0060.03316.57
5.6.80.0050.03116.29
5.6.70.0080.03016.35
5.6.60.0090.01716.28
5.6.50.0030.02916.20
5.6.40.0050.02916.37
5.6.30.0050.03316.09
5.6.20.0070.02716.26
5.6.10.0040.02416.22
5.6.00.0100.02616.17
5.5.380.0070.00613.00
5.5.370.0080.00012.92
5.5.360.0080.02715.41
5.5.350.0080.02815.42
5.5.340.0090.02215.52
5.5.330.0070.02915.54
5.5.320.0050.02515.57
5.5.310.0070.03015.59
5.5.300.0010.03315.52
5.5.290.0070.02915.53
5.5.280.0040.02115.51
5.5.270.0040.02415.63
5.5.260.0060.01915.42
5.5.250.0020.03315.52
5.5.240.0080.02615.25
5.5.230.0030.02815.35
5.5.220.0060.01715.32
5.5.210.0070.02415.30
5.5.200.0040.03015.26
5.5.190.0060.02315.20
5.5.180.0040.03115.36
5.5.170.0070.00612.82
5.5.160.0110.02215.30
5.5.150.0050.02915.21
5.5.140.0080.02215.23
5.5.130.0080.02615.34
5.5.120.0050.02815.31
5.5.110.0040.03315.33
5.5.100.0070.02815.12
5.5.90.0040.03115.26
5.5.80.0080.02715.19
5.5.70.0020.03615.21
5.5.60.0040.03115.22
5.5.50.0030.02815.32
5.5.40.0040.03215.20
5.5.30.0050.03115.21
5.5.20.0020.03415.34
5.5.10.0070.03215.18
5.5.00.0080.02715.34
5.4.450.0060.02914.18
5.4.440.0020.02914.19
5.4.430.0040.03014.18
5.4.420.0070.02814.25
5.4.410.0030.03214.14
5.4.400.0050.03114.08
5.4.390.0060.02414.15
5.4.380.0080.02314.11
5.4.370.0040.03014.17
5.4.360.0070.02814.20
5.4.350.0020.02414.14
5.4.340.0050.02514.19
5.4.330.0040.00511.72
5.4.320.0080.02614.17
5.4.310.0050.02714.17
5.4.300.0050.02814.17
5.4.290.0060.02814.14
5.4.280.0030.02314.22
5.4.270.0040.03014.13
5.4.260.0020.03014.18
5.4.250.0100.02314.19
5.4.240.0040.03114.16
5.4.230.0080.02614.15
5.4.220.0060.02614.08
5.4.210.0030.02814.13
5.4.200.0060.02514.07
5.4.190.0040.03114.21
5.4.180.0080.02914.19
5.4.170.0060.02814.11
5.4.160.0040.03214.15
5.4.150.0030.03114.19
5.4.140.0070.02613.24
5.4.130.0040.02513.17
5.4.120.0050.02713.28
5.4.110.0060.02313.25
5.4.100.0050.02813.22
5.4.90.0040.02313.22
5.4.80.0070.02313.25
5.4.70.0060.02713.26
5.4.60.0010.03013.26
5.4.50.0020.02013.23
5.4.40.0050.02013.30
5.4.30.0040.03113.24
5.4.20.0070.02413.26
5.4.10.0090.02413.26
5.4.00.0030.02813.10
5.3.290.0050.02812.69
5.3.280.0070.02412.63
5.3.270.0070.02412.63
5.3.260.0050.03012.65
5.3.250.0040.02812.68
5.3.240.0070.02212.66
5.3.230.0040.03012.66
5.3.220.0050.02812.65
5.3.210.0070.01912.62
5.3.200.0050.02912.66
5.3.190.0030.02712.67
5.3.180.0050.02612.63
5.3.170.0010.03512.67
5.3.160.0030.01912.66
5.3.150.0110.02412.62
5.3.140.0030.03212.61
5.3.130.0060.03012.63
5.3.120.0040.03112.65
5.3.110.0020.03012.65
5.3.100.0030.02112.43
5.3.90.0030.03112.48
5.3.80.0070.02912.41
5.3.70.0060.02812.44
5.3.60.0060.02812.43
5.3.50.0050.02512.46
5.3.40.0040.02012.45
5.3.30.0060.02912.45
5.3.20.0040.02212.37
5.3.10.0020.02812.36
5.3.00.0050.02512.31
5.2.170.0070.03011.93
5.2.160.0030.03511.93
5.2.150.0030.02711.93
5.2.140.0060.03311.93
5.2.130.0020.03511.93
5.2.120.0060.03411.93
5.2.110.0050.03311.93
5.2.100.0070.03211.93
5.2.90.0040.03511.93
5.2.80.0070.02511.93
5.2.70.0030.02311.93
5.2.60.0050.01911.93
5.2.50.0100.03011.93
5.2.40.0030.03211.93
5.2.30.0090.02811.93
5.2.20.0030.03211.93
5.2.10.0030.03511.93
5.2.00.0030.03511.93
5.1.60.0030.03011.93
5.1.50.0030.03211.93
5.1.40.0030.02111.93
5.1.30.0050.03111.93
5.1.20.0120.02611.93
5.1.10.0020.02911.93
5.1.00.0000.03211.93
5.0.50.0030.02011.93
5.0.40.0050.02211.93
5.0.30.0020.03211.93
5.0.20.0030.02011.93
5.0.10.0020.02411.93
5.0.00.0030.03311.93
4.4.90.0000.01611.93
4.4.80.0030.01711.93
4.4.70.0020.01811.93
4.4.60.0030.01811.93
4.4.50.0010.02011.93
4.4.40.0030.02111.93
4.4.30.0020.02011.93
4.4.20.0020.02011.93
4.4.10.0030.01911.93
4.4.00.0020.03011.93
4.3.110.0020.01811.93
4.3.100.0020.01311.93
4.3.90.0030.01711.93
4.3.80.0020.02411.93
4.3.70.0020.01811.93
4.3.60.0030.01911.93
4.3.50.0000.02211.93
4.3.40.0020.02811.93
4.3.30.0010.02011.93
4.3.20.0010.01811.93
4.3.10.0000.02011.93
4.3.00.0020.02011.93

preferences:
28.7 ms | 401 KiB | 5 Q