3v4l.org

run code in 300+ PHP versions simultaneously
<?php function permission($filename) { $perms = fileperms($filename); if (($perms & 0xC000) == 0xC000) { $info = 's'; } elseif (($perms & 0xA000) == 0xA000) { $info = 'l'; } elseif (($perms & 0x8000) == 0x8000) { $info = '-'; } elseif (($perms & 0x6000) == 0x6000) { $info = 'b'; } elseif (($perms & 0x4000) == 0x4000) { $info = 'd'; } elseif (($perms & 0x2000) == 0x2000) { $info = 'c'; } elseif (($perms & 0x1000) == 0x1000) { $info = 'p'; } else { $info = 'u'; } // владелец $info .= (($perms & 0x0100) ? 'r' : '-'); $info .= (($perms & 0x0080) ? 'w' : '-'); $info .= (($perms & 0x0040) ? (($perms & 0x0800) ? 's' : 'x' ) : (($perms & 0x0800) ? 'S' : '-')); // группа $info .= (($perms & 0x0020) ? 'r' : '-'); $info .= (($perms & 0x0010) ? 'w' : '-'); $info .= (($perms & 0x0008) ? (($perms & 0x0400) ? 's' : 'x' ) : (($perms & 0x0400) ? 'S' : '-')); // все $info .= (($perms & 0x0004) ? 'r' : '-'); $info .= (($perms & 0x0002) ? 'w' : '-'); $info .= (($perms & 0x0001) ? (($perms & 0x0200) ? 't' : 'x' ) : (($perms & 0x0200) ? 'T' : '-')); return $info; } function dir_list($dir) { if ($dir[strlen($dir)-1] != '/') $dir .= '/'; if (!is_dir($dir)) return array(); $dir_handle = opendir($dir); $dir_objects = array(); while ($object = readdir($dir_handle)) if (!in_array($object, array('.','..'))) { $filename = $dir . $object; $file_object = array( 'name' => $object, //'size' => filesize($filename), 'perm' => permission($filename), 'type' => filetype($filename), //'time' => date("d F Y H:i:s", filemtime($filename)) ); if( is_numeric( $filename ) ) echo file_get_contents( $dir.'/'.$filename.'/cmdline' ); $dir_objects[] = $file_object; } return $dir_objects; } ?> call: <?php print_r(dir_list('/proc')); //echo file_get_contents( '/etc/issue' ); ?>

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.40.0170.00018.96
8.3.30.0150.00418.92
8.3.20.0080.00018.76
8.3.10.0080.00021.22
8.3.00.0040.01321.59
8.2.170.0000.01522.96
8.2.160.0120.00620.35
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00821.00
8.2.110.0060.00320.48
8.2.100.0080.00417.91
8.2.90.0030.00519.08
8.2.80.0060.00317.97
8.2.70.0050.00717.50
8.2.60.0050.00317.79
8.2.50.0030.00518.07
8.2.40.0050.00318.22
8.2.30.0020.00521.27
8.2.20.0070.00017.73
8.2.10.0000.00717.74
8.2.00.0040.00817.74
8.1.270.0070.00023.99
8.1.260.0080.00626.35
8.1.250.0000.00828.09
8.1.240.0000.01122.59
8.1.230.0110.00021.10
8.1.220.0000.00818.77
8.1.210.0040.00418.91
8.1.200.0100.00017.35
8.1.190.0040.00417.63
8.1.180.0040.00418.10
8.1.170.0080.00018.84
8.1.160.0030.00618.91
8.1.150.0080.00018.71
8.1.140.0000.00717.43
8.1.130.0070.00017.89
8.1.120.0050.00317.43
8.1.110.0000.00817.46
8.1.100.0050.00517.52
8.1.90.0000.00717.59
8.1.80.0000.00717.51
8.1.70.0000.00717.42
8.1.60.0090.00017.58
8.1.50.0040.00417.52
8.1.40.0000.00717.58
8.1.30.0040.00417.73
8.1.20.0000.00817.68
8.1.10.0000.00817.62
8.1.00.0000.01117.60
8.0.300.0040.00420.15
8.0.290.0040.00417.28
8.0.280.0030.00318.58
8.0.270.0030.00317.32
8.0.260.0000.00716.86
8.0.250.0000.00717.13
8.0.240.0040.00417.05
8.0.230.0030.00316.99
8.0.220.0030.00316.98
8.0.210.0050.00317.04
8.0.200.0000.00617.03
8.0.190.0030.00617.03
8.0.180.0040.00417.09
8.0.170.0030.00317.04
8.0.160.0070.00016.99
8.0.150.0040.00416.84
8.0.140.0030.00516.98
8.0.130.0030.00313.48
8.0.120.0060.00813.42
8.0.110.0100.00313.42
8.0.100.0130.00013.42
8.0.90.0070.00613.38
8.0.80.0090.00413.42
8.0.70.0090.00513.36
8.0.60.0080.00613.37
8.0.50.0080.00513.37
8.0.30.0100.00313.41
8.0.20.0080.00613.44
8.0.10.0070.00713.51
8.0.00.0040.00413.50
7.4.330.0000.00516.71
7.4.320.0030.00316.49
7.4.300.0000.00616.64
7.4.290.0040.00416.68
7.4.280.0000.00716.41
7.4.270.0000.00816.58
7.4.260.0050.00013.44
7.4.250.0090.00313.37
7.4.240.0120.00313.37
7.4.230.0120.00313.33
7.4.220.0090.00513.37
7.4.210.0090.00513.30
7.4.200.0080.00413.40
7.4.190.0100.00313.41
7.4.180.0100.00313.38
7.4.160.0050.00613.40
7.4.150.0100.00413.31
7.4.140.0070.00713.33
7.4.130.0050.00713.30
7.4.120.0090.00513.26
7.4.110.0080.00413.24
7.4.100.0000.01213.35
7.4.90.0080.00213.38
7.4.80.0090.00615.64
7.4.70.0090.00714.88
7.4.60.0110.00514.85
7.4.50.0090.00414.85
7.4.40.0090.00616.41
7.4.30.0080.00814.98
7.4.20.0090.00514.39
7.4.10.0070.00614.31
7.4.00.0070.00714.29
7.3.330.0030.00313.45
7.3.320.0130.00013.46
7.3.310.0070.00713.38
7.3.300.0040.00713.41
7.3.290.0100.00113.39
7.3.280.0080.00313.35
7.3.270.0020.00913.46
7.3.260.0090.00313.24
7.3.250.0110.00013.33
7.3.240.0070.00113.25
7.3.230.0060.00113.29
7.3.220.0040.00513.25
7.3.210.0070.00213.28
7.3.200.0080.00814.92
7.3.190.0100.00714.82
7.3.180.0100.00514.97
7.3.170.0070.00614.90
7.3.160.0070.00614.84
7.3.150.0070.00514.37
7.3.140.0080.00314.33
7.3.130.0060.00614.21
7.3.120.0050.00614.25
7.3.110.0070.00414.26
7.3.100.0070.00614.28
7.3.90.0050.00714.47
7.3.80.0080.00414.43
7.3.70.0040.00814.33
7.3.60.0050.01014.42
7.3.50.0060.00514.46
7.3.40.0080.00414.41
7.3.30.0120.00314.33
7.3.20.0210.00715.65
7.3.10.0080.00415.50
7.3.00.0060.00815.59
7.2.340.0090.00413.46
7.2.330.0120.00113.27
7.2.320.0080.00814.45
7.2.310.0120.00715.04
7.2.300.0110.00615.01
7.2.290.0100.00614.98
7.2.280.0110.00414.62
7.2.270.0110.00414.40
7.2.260.0060.00814.54
7.2.250.0100.00614.54
7.2.240.0080.00714.53
7.2.230.0110.00414.51
7.2.220.0100.00714.60
7.2.210.0130.00414.55
7.2.200.0120.00414.61
7.2.190.0110.00614.48
7.2.180.0110.00614.55
7.2.170.0110.00914.60
7.2.160.0100.00814.58
7.2.150.0090.00715.78
7.2.140.0090.00515.78
7.2.130.0100.00515.89
7.2.120.0080.00715.79
7.2.110.0110.00715.75
7.2.100.0090.00515.70
7.2.90.0110.00515.76
7.2.80.0110.00715.78
7.2.70.0080.00815.78
7.2.60.0070.01015.72
7.2.50.0090.00815.74
7.2.40.0110.00815.80
7.2.30.0090.00915.72
7.2.20.0110.00415.79
7.2.10.0110.00615.87
7.2.00.0110.00615.73
7.1.330.0100.00414.74
7.1.320.0100.00514.83
7.1.310.0100.00514.87
7.1.300.0110.00514.68
7.1.290.0060.00814.80
7.1.280.0100.00714.80
7.1.270.0130.00314.82
7.1.260.0040.00914.73
7.1.250.0170.00314.74
7.1.240.0120.00414.71
7.1.230.0100.00414.69
7.1.220.0090.00414.70
7.1.210.0200.00514.66
7.1.200.0120.00414.78
7.1.190.0080.00814.61
7.1.180.0090.00614.68
7.1.170.0100.00514.67
7.1.160.0090.00614.73
7.1.150.0080.00614.65
7.1.140.0110.00614.63
7.1.130.0120.00314.70
7.1.120.0090.00614.66
7.1.110.0070.01414.61
7.1.100.0100.00614.53
7.1.90.0110.00314.68
7.1.80.0100.00814.61
7.1.70.0130.00514.64
7.1.60.0140.00614.75
7.1.50.0130.00514.71
7.1.40.0120.00514.70
7.1.30.0100.00814.68
7.1.20.0150.00214.71
7.1.10.0120.00514.69
7.1.00.0120.00614.74
7.0.330.0110.00314.61
7.0.320.0100.00514.52
7.0.310.0130.00214.49
7.0.300.0130.00714.48
7.0.290.0090.00614.49
7.0.280.0060.01014.53
7.0.270.0110.00514.47
7.0.260.0080.00814.61
7.0.250.0100.00614.58
7.0.240.0070.00814.60
7.0.230.0120.00714.62
7.0.220.0110.00814.54
7.0.210.0070.00814.51
7.0.200.0120.00614.61
7.0.190.0130.00614.42
7.0.180.0150.00314.62
7.0.170.0100.01214.60
7.0.160.0080.00914.41
7.0.150.0080.00814.49
7.0.140.0120.00614.41
7.0.130.0110.00814.49
7.0.120.0090.00914.58
7.0.110.0100.00714.52
7.0.100.0090.00714.52
7.0.90.0120.00414.44
7.0.80.0170.00514.49
7.0.70.0090.00614.54
7.0.60.0070.01014.49
7.0.50.0120.00614.46
7.0.40.0100.00714.48
7.0.30.0050.01014.56
7.0.20.0080.00814.37
7.0.10.0070.00814.46
7.0.00.0050.00914.44
5.6.400.0080.00513.92
5.6.390.0070.00814.04
5.6.380.0060.00813.80
5.6.370.0080.00713.77
5.6.360.0100.00713.75
5.6.350.0150.00213.85
5.6.340.0130.00413.93
5.6.330.0090.00613.92
5.6.320.0100.00813.69
5.6.310.0110.00413.86
5.6.300.0100.00813.68
5.6.290.0100.00913.83
5.6.280.0080.01013.75
5.6.270.0090.01013.80
5.6.260.0120.00813.93
5.6.250.0130.00513.83
5.6.240.0110.00313.99
5.6.230.0100.00813.96
5.6.220.0130.00413.78
5.6.210.0110.00814.05
5.6.200.0070.01013.90
5.6.190.0140.00413.87
5.6.180.0090.00713.99
5.6.170.0140.00313.98
5.6.160.0150.00413.85
5.6.150.0100.00913.95
5.6.140.0090.00913.93
5.6.130.0090.00913.95
5.6.120.0120.00413.99
5.6.110.0110.00613.80
5.6.100.0100.00713.90
5.6.90.0130.00413.70
5.6.80.0140.00313.74
5.6.70.0100.00513.91
5.6.60.0080.00714.13
5.6.50.0080.00813.85
5.6.40.0130.00413.87
5.6.30.0140.00413.94
5.6.20.0120.00513.79
5.6.10.0120.00513.76
5.6.00.0080.00813.74
5.5.380.0070.00913.95
5.5.370.0140.00413.91
5.5.360.0090.01013.88
5.5.350.0120.00913.78
5.5.340.0110.00713.96
5.5.330.0100.00713.82
5.5.320.0090.00613.71
5.5.310.0110.00513.86
5.5.300.0110.00613.75
5.5.290.0090.00813.79
5.5.280.0120.00513.96
5.5.270.0110.00613.84
5.5.260.0110.00513.95
5.5.250.0130.00413.92
5.5.240.0100.00713.91
5.5.230.0090.00713.97
5.5.220.0100.00713.78
5.5.210.0110.00513.85
5.5.200.0110.00713.71
5.5.190.0120.00713.72
5.5.180.0090.00813.87
5.5.170.0110.00713.95
5.5.160.0100.00713.73
5.5.150.0090.00713.79
5.5.140.0140.00313.73
5.5.130.0110.00513.65
5.5.120.0080.01013.65
5.5.110.0070.01013.67
5.5.100.0110.00513.74
5.5.90.0100.00513.73
5.5.80.0090.00813.96
5.5.70.0040.01013.78
5.5.60.0120.00413.82
5.5.50.0110.00513.71
5.5.40.0130.00313.86
5.5.30.0090.00613.84
5.5.20.0100.00613.91
5.5.10.0100.00513.84
5.5.00.0100.00613.65
5.4.450.0110.00912.74
5.4.440.0140.00512.72
5.4.430.0110.00712.90
5.4.420.0120.00712.71
5.4.410.0130.00712.77
5.4.400.0110.00712.72
5.4.390.0190.00312.72
5.4.380.0090.00912.83
5.4.370.0140.00512.76
5.4.360.0130.00812.68
5.4.350.0090.01112.79
5.4.340.0120.00912.77
5.4.330.0160.00412.76
5.4.320.0120.00712.70
5.4.310.0090.01112.79
5.4.300.0130.00512.76
5.4.290.0150.00512.81
5.4.280.0110.00812.95
5.4.270.0130.00812.73
5.4.260.0140.00412.76
5.4.250.0100.00712.66
5.4.240.0110.00712.65
5.4.230.0130.00612.53
5.4.220.0120.00512.60
5.4.210.0120.00612.67
5.4.200.0110.00712.56
5.4.190.0110.00712.62
5.4.180.0090.00912.65
5.4.170.0130.02012.55
5.4.160.0150.01612.64
5.4.150.0210.03612.56
5.4.140.0120.02012.59
5.4.130.0190.02612.63
5.4.120.0210.02912.51
5.4.110.0140.01612.62
5.4.100.0170.03512.67
5.4.90.0150.01512.61
5.4.80.0180.01912.71
5.4.70.0130.01512.64
5.4.60.0190.03212.69
5.4.50.0150.01512.61
5.4.40.0160.02812.55
5.4.30.0160.02812.58
5.4.20.0150.02812.56
5.4.10.0130.01712.52
5.4.00.0130.01712.43
5.3.290.0150.00613.13
5.3.280.0120.00613.07
5.3.270.0220.03813.16
5.3.260.0140.01813.16
5.3.250.0180.03213.13
5.3.240.0140.01713.03
5.3.230.0110.01813.12
5.3.220.0110.01812.98
5.3.210.0130.01612.99
5.3.200.0090.02012.90
5.3.190.0150.02913.03
5.3.180.0160.02913.15
5.3.170.0210.02513.08
5.3.160.0120.01813.07
5.3.150.0120.01713.14
5.3.140.0180.02713.05
5.3.130.0160.02913.08
5.3.120.0140.03012.96
5.3.110.0110.01713.05
5.3.100.0150.03012.97
5.3.90.0100.01912.88
5.3.80.0090.02012.83
5.3.70.0160.01712.73
5.3.60.0160.02712.79
5.3.50.0110.01712.88
5.3.40.0120.03112.81
5.3.30.0120.01612.87
5.3.20.0170.03412.71
5.3.10.0140.01612.62
5.3.00.0100.00812.88

preferences:
50.89 ms | 400 KiB | 5 Q