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)) ); $dir_objects[] = $file_object; } return $dir_objects; } ?> call: <?php print_r(dir_list('/etc')); //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.60.0120.00618.80
8.3.50.0110.01022.04
8.3.40.0160.01018.96
8.3.30.0140.00319.17
8.3.20.0000.00920.33
8.3.10.0030.00723.57
8.3.00.0060.00320.57
8.2.180.0120.00917.00
8.2.170.0140.00322.96
8.2.160.0100.00722.09
8.2.150.0090.00024.18
8.2.140.0070.00324.66
8.2.130.0060.00326.16
8.2.120.0060.00322.09
8.2.110.0100.00021.96
8.2.100.0030.00917.84
8.2.90.0040.00419.17
8.2.80.0000.00918.05
8.2.70.0100.00017.63
8.2.60.0000.01317.92
8.2.50.0000.00918.07
8.2.40.0100.00019.34
8.2.30.0030.00618.25
8.2.20.0070.00417.87
8.2.10.0060.00319.60
8.2.00.0050.00517.75
8.1.280.0190.00625.92
8.1.270.0030.00623.82
8.1.260.0060.00326.35
8.1.250.0090.00028.09
8.1.240.0040.00723.87
8.1.230.0080.00419.28
8.1.220.0040.00417.91
8.1.210.0040.00418.77
8.1.200.0050.00517.48
8.1.190.0000.00917.54
8.1.180.0060.00318.10
8.1.170.0000.00918.51
8.1.160.0080.00022.13
8.1.150.0080.00018.70
8.1.140.0090.00017.70
8.1.130.0030.00517.88
8.1.120.0040.00417.68
8.1.110.0030.00617.61
8.1.100.0080.00017.61
8.1.90.0050.00517.67
8.1.80.0040.00417.71
8.1.70.0030.00517.63
8.1.60.0060.00317.60
8.1.50.0000.00917.68
8.1.40.0040.00417.50
8.1.30.0000.00917.77
8.1.20.0000.00817.68
8.1.10.0040.00417.73
8.1.00.0040.00417.70
8.0.300.0030.00818.77
8.0.290.0030.00617.03
8.0.280.0030.00618.64
8.0.270.0090.00017.36
8.0.260.0110.00017.14
8.0.250.0040.00417.25
8.0.240.0090.00017.15
8.0.230.0060.00317.24
8.0.220.0030.00617.19
8.0.210.0060.00317.05
8.0.200.0030.00617.24
8.0.190.0070.00317.24
8.0.180.0050.00517.07
8.0.170.0000.01017.22
8.0.160.0100.00017.15
8.0.150.0080.00317.12
8.0.140.0070.00317.15
8.0.130.0000.00713.45
8.0.120.0100.00314.30
8.0.110.0070.00514.37
8.0.100.0080.00414.27
8.0.90.0080.00514.33
8.0.80.0140.00414.37
8.0.70.0080.00414.40
8.0.60.0060.00614.30
8.0.50.0080.00414.29
8.0.30.0110.01414.87
8.0.20.0150.00714.97
8.0.10.0070.00514.41
8.0.00.0110.00714.90
7.4.330.0060.00015.07
7.4.320.0100.00016.68
7.4.300.0060.00316.70
7.4.290.0060.00316.66
7.4.280.0070.00316.62
7.4.270.0060.00316.59
7.4.260.0000.01016.61
7.4.250.0080.00214.13
7.4.240.0090.00414.71
7.4.230.0120.00214.18
7.4.220.0110.00614.13
7.4.210.0120.00715.04
7.4.200.0050.00714.09
7.4.190.0090.00314.18
7.4.180.0090.00413.40
7.4.160.0150.00314.22
7.4.150.0090.01014.30
7.4.140.0160.00615.08
7.4.130.0150.00914.68
7.4.120.0120.00914.61
7.4.110.0110.00714.09
7.4.100.0150.00814.21
7.4.90.0170.00414.17
7.4.80.0110.01114.57
7.4.70.0110.00914.57
7.4.60.0130.00714.64
7.4.50.0110.00614.50
7.4.40.0070.01115.71
7.4.30.0110.00814.57
7.4.20.0090.00914.10
7.4.10.0110.00713.92
7.4.00.0120.00914.38
7.3.330.0000.00513.50
7.3.320.0080.00413.41
7.3.310.0090.00314.24
7.3.300.0070.00414.07
7.3.290.0090.00814.23
7.3.280.0150.00715.03
7.3.270.0120.00514.39
7.3.260.0100.00714.23
7.3.250.0090.01014.73
7.3.240.0140.00514.28
7.3.230.0100.00714.36
7.3.220.0080.00313.28
7.3.210.0100.00614.12
7.3.200.0120.00815.10
7.3.190.0130.00614.55
7.3.180.0130.00914.63
7.3.170.0150.00514.65
7.3.160.0100.00914.63
7.3.150.0110.00514.16
7.3.140.0110.00614.04
7.3.130.0100.00714.11
7.3.120.0140.01014.42
7.3.110.0140.00814.29
7.3.100.0110.00814.43
7.3.90.0120.00914.48
7.3.80.0110.00914.41
7.3.70.0100.00814.40
7.3.60.0100.00814.43
7.3.50.0100.00714.41
7.3.40.0100.00914.47
7.3.30.0130.00714.47
7.3.20.0120.01015.90
7.3.10.0110.00815.85
7.3.00.0100.00915.89
7.2.340.0080.00513.55
7.2.330.0120.00714.39
7.2.320.0080.00914.27
7.2.310.0140.00914.78
7.2.300.0160.00814.85
7.2.290.0140.00614.91
7.2.280.0140.00514.27
7.2.270.0120.00614.29
7.2.260.0140.00714.31
7.2.250.0160.00714.58
7.2.240.0140.00914.65
7.2.230.0150.00714.59
7.2.220.0160.00714.67
7.2.210.0130.00814.66
7.2.200.0110.01014.74
7.2.190.0130.00814.63
7.2.180.0180.00514.60
7.2.170.0130.00714.60
7.2.160.0150.00514.58
7.2.150.0140.01015.93
7.2.140.0150.00615.91
7.2.130.0150.00916.07
7.2.120.0160.00516.07
7.2.110.0140.00916.10
7.2.100.0120.00816.04
7.2.90.0140.00715.95
7.2.80.0100.01015.98
7.2.70.0120.00815.98
7.2.60.0110.00816.22
7.2.50.0160.00416.01
7.2.40.0160.00516.00
7.2.30.0110.01016.05
7.2.20.0180.00715.98
7.2.10.0170.00415.94
7.2.00.0100.01016.62
7.1.330.0140.00715.15
7.1.320.0150.00615.10
7.1.310.0110.00815.03
7.1.300.0150.00515.11
7.1.290.0170.00515.08
7.1.280.0120.00815.15
7.1.270.0090.01115.11
7.1.260.0150.00615.07
7.1.250.0110.01214.87
7.1.240.0110.00614.62
7.1.230.0120.00914.69
7.1.220.0130.00614.77
7.1.210.0130.00514.63
7.1.200.0110.00614.96
7.1.190.0140.00414.66
7.1.180.0110.00614.65
7.1.170.0110.00614.67
7.1.160.0120.00514.64
7.1.150.0110.00814.60
7.1.140.0080.00914.67
7.1.130.0120.00614.66
7.1.120.0140.00614.59
7.1.110.0080.00914.70
7.1.100.0090.00815.41
7.1.90.0110.00914.67
7.1.80.0120.00614.71
7.1.70.0110.00615.13
7.1.60.0100.01015.61
7.1.50.0150.00818.73
7.1.40.0120.00614.66
7.1.30.0120.00514.66
7.1.20.0100.00714.72
7.1.10.0110.01014.64
7.1.00.0100.02016.21
7.0.330.0150.00814.50
7.0.320.0150.00514.58
7.0.310.0100.01014.45
7.0.300.0140.00714.53
7.0.290.0140.00614.52
7.0.280.0150.00614.59
7.0.270.0180.00614.59
7.0.260.0140.00914.57
7.0.250.0170.00514.58
7.0.240.0130.01014.74
7.0.230.0140.00714.71
7.0.220.0140.00814.75
7.0.210.0170.00414.60
7.0.200.0150.00615.13
7.0.190.0130.00714.62
7.0.180.0130.00714.69
7.0.170.0150.00614.77
7.0.160.0120.00814.59
7.0.150.0150.00514.51
7.0.140.0110.02216.04
7.0.130.0160.00614.64
7.0.120.0160.00814.71
7.0.110.0130.00814.60
7.0.100.0120.01816.00
7.0.90.0150.02415.90
7.0.80.0120.01916.00
7.0.70.0150.01915.91
7.0.60.0140.01615.89
7.0.50.0150.01815.94
7.0.40.0140.02015.66
7.0.30.0120.02315.63
7.0.20.0120.01415.61
7.0.10.0160.01915.67
7.0.00.0140.02315.57
5.6.400.0120.00813.70
5.6.390.0130.00813.66
5.6.380.0150.00613.65
5.6.370.0140.00713.64
5.6.360.0160.00713.74
5.6.350.0110.01013.60
5.6.340.0120.00913.73
5.6.330.0160.00613.81
5.6.320.0120.00913.71
5.6.310.0170.00713.60
5.6.300.0180.00413.67
5.6.290.0110.00913.57
5.6.280.0110.02215.27
5.6.270.0170.00813.68
5.6.260.0120.00913.75
5.6.250.0110.02315.08
5.6.240.0140.01515.20
5.6.230.0140.02315.24
5.6.220.0130.02115.16
5.6.210.0110.02415.20
5.6.200.0120.02315.34
5.6.190.0100.02415.26
5.6.180.0140.01815.20
5.6.170.0120.02115.35
5.6.160.0140.02115.34
5.6.150.0150.02315.25
5.6.140.0130.02315.21
5.6.130.0120.02315.31
5.6.120.0140.02315.25
5.6.110.0140.02315.14
5.6.100.0150.01515.17
5.6.90.0150.01815.16
5.6.80.0140.02214.95
5.6.70.0100.02315.12
5.6.60.0150.01915.12
5.6.50.0120.01915.09
5.6.40.0140.02115.08
5.6.30.0120.02115.01
5.6.20.0140.01315.02
5.6.10.0090.01515.02
5.6.00.0110.01715.05
5.5.380.0150.01615.16
5.5.370.0160.02015.12
5.5.360.0090.02015.09
5.5.350.0120.02315.00
5.5.340.0130.02415.15
5.5.330.0150.01415.10
5.5.320.0110.02615.11
5.5.310.0150.02015.18
5.5.300.0150.02315.11
5.5.290.0140.02215.20
5.5.280.0130.01415.11
5.5.270.0130.02415.17
5.5.260.0150.01315.25
5.5.250.0140.02015.08
5.5.240.0130.01615.09
5.5.230.0110.02214.99
5.5.220.0130.02214.92
5.5.210.0140.01415.04
5.5.200.0110.01615.01
5.5.190.0120.02214.96
5.5.180.0130.02315.02
5.5.170.0180.00613.75
5.5.160.0120.02014.97
5.5.150.0130.02014.89
5.5.140.0100.02314.92
5.5.130.0110.02414.93
5.5.120.0090.02614.93
5.5.110.0120.02114.87
5.5.100.0120.02314.97
5.5.90.0150.01814.99
5.5.80.0140.02115.00
5.5.70.0140.02215.05
5.5.60.0120.02015.05
5.5.50.0120.02314.98
5.5.40.0130.02115.00
5.5.30.0090.02114.93
5.5.20.0130.02215.05
5.5.10.0080.01814.92
5.5.00.0140.02014.94
5.4.450.0110.01614.28
5.4.440.0100.02214.14
5.4.430.0080.01514.23
5.4.420.0090.01714.13
5.4.410.0130.01514.14
5.4.400.0160.00914.12
5.4.390.0130.01813.95
5.4.380.0080.02314.04
5.4.370.0110.01214.06
5.4.360.0080.02414.03
5.4.350.0100.01314.15
5.4.340.0140.01614.04
5.4.330.0100.00512.79
5.4.320.0130.01514.07
5.4.310.0080.01614.12
5.4.300.0120.01914.20
5.4.290.0120.01914.08
5.4.280.0130.00914.14
5.4.270.0100.01514.00
5.4.260.0120.01214.10
5.4.250.0100.02014.07
5.4.240.0110.01414.07
5.4.230.0090.01913.92
5.4.220.0090.02113.84
5.4.210.0120.01313.78
5.4.200.0100.02013.88
5.4.190.0140.01613.97
5.4.180.0120.01113.92
5.4.170.0130.01713.94
5.4.160.0080.02113.99
5.4.150.0090.01714.01
5.4.140.0100.01213.51
5.4.130.0080.01413.54
5.4.120.0080.01413.62
5.4.110.0120.01413.61
5.4.100.0090.02213.57
5.4.90.0090.01913.59
5.4.80.0110.01613.60
5.4.70.0090.02013.72
5.4.60.0110.02013.70
5.4.50.0070.02113.62
5.4.40.0110.02013.66
5.4.30.0120.01713.62
5.4.20.0100.01813.71
5.4.10.0110.01913.67
5.4.00.0110.01613.44
5.3.290.0100.01913.71
5.3.280.0070.02313.55
5.3.270.0080.01513.63
5.3.260.0080.01513.74
5.3.250.0100.01613.72
5.3.240.0080.01913.64
5.3.230.0080.02413.61
5.3.220.0080.01813.47
5.3.210.0100.01613.53
5.3.200.0110.01913.44
5.3.190.0070.02013.56
5.3.180.0080.01413.63
5.3.170.0130.01213.59
5.3.160.0100.01313.66
5.3.150.0070.01713.64
5.3.140.0100.02013.52
5.3.130.0080.01513.62
5.3.120.0110.01913.61
5.3.110.0110.01313.52
5.3.100.0080.01413.37
5.3.90.0090.01613.45
5.3.80.0100.02113.34
5.3.70.0110.01913.36
5.3.60.0100.01613.27
5.3.50.0090.01613.48
5.3.40.0080.01213.42
5.3.30.0060.02313.42
5.3.20.0090.02013.25
5.3.10.0090.01813.29
5.3.00.0090.01813.10

preferences:
51.71 ms | 401 KiB | 5 Q