3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Bug { class Directory extends \RecursiveDirectoryIterator { protected $_splFileInfoClass = null; protected $_relativePath = null; public function __construct ( $path, $flags = null, $splFileInfoClass = null ) { if(null === $flags) parent::__construct($path); else parent::__construct($path, $flags); $this->setSplFileInfoClass($splFileInfoClass); $this->setRelativePath($path); return; } public function current ( ) { $out = parent::current(); if( null !== $this->_splFileInfoClass && $out instanceof \SplFileInfo) { $out->setInfoClass($this->_splFileInfoClass); $out = $out->getFileInfo(); if($out instanceof SplFileInfo) $out->setRelativePath($this->getRelativePath()); } return $out; } public function getChildren ( ) { $out = parent::getChildren(); $out->setRelativePath($this->getRelativePath()); if($out instanceof \RecursiveDirectoryIterator) $out->setSplFileInfoClass($this->_splFileInfoClass); return $out; } public function setSplFileInfoClass ( $splFileInfoClass ) { $this->_splFileInfoClass = $splFileInfoClass; return; } public function setRelativePath ( $path ) { $this->_relativePath = $path; return; } public function getRelativePath ( ) { return $this->_relativePath; } } class SplFileInfo extends \SplFileInfo { protected $_relativePath = null; public function __construct ( $filename, $relativePath = null ) { parent::__construct($filename); $this->_relativePath = $relativePath; return; } public function setRelativePath ( $relativePath ) { $old = $this->_relativePath; $this->_relativePath = $relativePath; return $old; } public function getRelativePath ( ) { return $this->_relativePath; } public function getRelativePathname ( ) { if(null === $relative = $this->getRelativePath()) return $this->getPathname(); return substr($this->getPathname(), strlen($relative)); } } } namespace { $finder = new Bug\Directory('.'); $finder->setSplFileInfoClass('Bug\SplFileInfo'); foreach(new \RecursiveIteratorIterator($finder) as $entry) var_dump($entry->getRelativePathname()); }

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.0070.00718.88
8.3.30.0080.00819.23
8.3.20.0080.00020.38
8.3.10.0040.00423.66
8.3.00.0040.00419.38
8.2.170.0060.00922.96
8.2.160.0070.00720.35
8.2.150.0000.00924.18
8.2.140.0080.00024.66
8.2.130.0060.00926.16
8.2.120.0050.00322.31
8.2.110.0060.00320.34
8.2.100.0120.00017.78
8.2.90.0000.00819.23
8.2.80.0040.00417.97
8.2.70.0000.00817.50
8.2.60.0000.00817.64
8.2.50.0090.00018.07
8.2.40.0030.00618.22
8.2.30.0050.00217.93
8.2.20.0040.00417.64
8.2.10.0040.00417.92
8.2.00.0000.01217.69
8.1.270.0080.00022.23
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0050.00520.87
8.1.230.0110.00019.16
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.22
8.1.190.0030.00517.41
8.1.180.0060.00318.10
8.1.170.0040.00818.64
8.1.160.0000.00821.91
8.1.150.0050.00218.61
8.1.140.0040.00417.29
8.1.130.0030.00317.72
8.1.120.0000.00717.42
8.1.110.0000.00717.29
8.1.100.0060.00317.42
8.1.90.0050.00217.36
8.1.80.0040.00417.29
8.1.70.0070.00017.25
8.1.60.0090.00017.55
8.1.50.0000.00817.55
8.1.40.0040.00417.34
8.1.30.0030.00617.55
8.1.20.0050.00217.53
8.1.10.0040.00417.55
8.1.00.0050.00317.46
8.0.300.0040.00418.77
8.0.290.0030.00517.18
8.0.280.0050.00318.45
8.0.270.0000.00717.17
8.0.260.0000.00716.85
8.0.250.0040.00417.05
8.0.240.0070.00016.98
8.0.230.0070.00017.02
8.0.220.0040.00316.95
8.0.210.0070.00016.91
8.0.200.0030.00316.98
8.0.190.0000.00817.05
8.0.180.0040.00416.84
8.0.170.0030.00516.96
8.0.160.0080.00016.95
8.0.150.0000.00716.95
8.0.140.0040.00416.83
8.0.130.0000.00713.52
8.0.120.0080.00016.90
8.0.110.0080.00016.88
8.0.100.0070.00017.00
8.0.90.0040.00416.85
8.0.80.0060.01016.88
8.0.70.0040.00416.85
8.0.60.0020.00516.93
8.0.50.0000.00816.83
8.0.30.0120.00716.87
8.0.20.0050.01717.40
8.0.10.0040.00416.95
8.0.00.0070.01116.80
7.4.330.0070.00015.04
7.4.320.0000.00616.45
7.4.300.0040.00416.39
7.4.290.0000.00816.46
7.4.280.0090.00016.50
7.4.270.0030.00316.60
7.4.260.0000.00716.38
7.4.250.0000.00816.44
7.4.240.0060.00116.46
7.4.230.0000.00716.66
7.4.220.0090.01016.70
7.4.210.0070.01016.61
7.4.200.0080.00016.61
7.4.190.0000.00716.71
7.4.160.0110.00716.45
7.4.150.0070.01017.40
7.4.140.0150.02117.86
7.4.130.0090.00816.63
7.4.120.0090.00916.50
7.4.110.0090.00916.54
7.4.100.0040.01316.36
7.4.90.0110.00816.59
7.4.80.0060.01219.39
7.4.70.0060.01016.61
7.4.60.0110.00516.61
7.4.50.0040.00416.13
7.4.40.0070.01022.77
7.4.30.0190.00016.52
7.4.00.0070.01014.86
7.3.330.0030.00313.43
7.3.320.0030.00313.60
7.3.310.0050.00216.50
7.3.300.0040.00416.41
7.3.290.0070.00716.54
7.3.280.0050.01316.50
7.3.270.0140.00317.40
7.3.260.0140.00316.77
7.3.250.0110.00716.48
7.3.240.0160.00316.38
7.3.230.0100.00616.53
7.3.210.0040.01316.77
7.3.200.0110.01419.39
7.3.190.0130.00916.35
7.3.180.0060.00916.45
7.3.170.0030.01316.66
7.3.160.0080.00816.70
7.3.120.0030.01315.06
7.2.330.0110.00816.62
7.2.320.0070.01016.67
7.2.310.0120.00616.64
7.2.300.0110.00516.66
7.2.290.0130.00316.68
7.2.60.0030.00916.92
7.2.00.0000.01219.02
7.1.200.0070.00715.68
7.1.100.0050.00518.05
7.1.70.0000.00817.03
7.1.60.0140.01019.33
7.1.50.0090.00916.92
7.1.00.0030.07722.30
7.0.200.0040.01116.73
7.0.140.0000.07022.00
7.0.100.0100.08319.98
7.0.90.0070.07719.97
7.0.80.0170.09019.99
7.0.70.0100.07319.98
7.0.60.0100.08320.10
7.0.50.0230.06720.30
7.0.40.0100.06319.95
7.0.30.0170.06320.19
7.0.20.0070.06020.07
7.0.10.0100.07320.08
7.0.00.0070.07020.14
5.6.280.0030.07321.14
5.6.250.0200.04020.72
5.6.240.0070.08320.74
5.6.230.0070.08020.53
5.6.220.0130.07320.76
5.6.210.0100.08020.73
5.6.200.0030.08721.09
5.6.190.0070.08021.11
5.6.180.0100.07320.94
5.6.170.0230.07021.19
5.6.160.0100.08021.12
5.6.150.0070.08021.16
5.6.140.0170.06321.13
5.6.130.0030.05321.18
5.6.120.0100.07721.00
5.6.110.0070.08721.10
5.6.100.0170.07321.04
5.6.90.0200.07321.20
5.6.80.0070.05320.56
5.6.70.0130.05720.60
5.6.60.0070.08020.50
5.6.50.0000.05020.48
5.6.40.0200.05720.45
5.6.30.0100.07720.45
5.6.20.0130.05720.33
5.6.10.0070.07320.45
5.6.00.0170.07320.46
5.5.380.0070.07720.55
5.5.370.0070.05320.40
5.5.360.0170.07320.46
5.5.350.0100.05020.52
5.5.340.0100.07720.95
5.5.330.0070.08320.91
5.5.320.0130.07720.98
5.5.310.0200.06720.94
5.5.300.0170.06720.94
5.5.290.0070.07320.82
5.5.280.0030.08320.85
5.5.270.0000.07720.94
5.5.260.0070.08320.77
5.5.250.0030.09020.73
5.5.240.0130.07320.08
5.5.230.0030.08720.20
5.5.220.0130.07320.29
5.5.210.0070.08320.20
5.5.200.0100.07720.21
5.5.190.0100.07320.13
5.5.180.0070.07320.32
5.5.160.0130.07720.20
5.5.150.0030.07720.19
5.5.140.0100.08720.29
5.5.130.0130.07020.31
5.5.120.0170.07720.19
5.5.110.0130.04720.29
5.5.100.0130.04020.03
5.5.90.0100.07320.09
5.5.80.0130.07019.98
5.5.70.0070.05320.14
5.5.60.0130.06720.20
5.5.50.0100.07020.20
5.5.40.0070.07720.02
5.5.30.0030.08020.12
5.5.20.0070.08320.10
5.5.10.0100.08020.02
5.5.00.0070.08020.15
5.4.450.0100.07719.20
5.4.440.0230.06719.36
5.4.430.0070.08019.19
5.4.420.0100.05719.48
5.4.410.0100.07719.24
5.4.400.0000.05318.88
5.4.390.0070.05718.85
5.4.380.0200.06018.95
5.4.370.0070.05718.82
5.4.360.0070.07718.91
5.4.350.0100.07718.85
5.4.340.0030.05019.05
5.4.320.0130.07318.95
5.4.310.0100.07319.16
5.4.300.0100.06719.04
5.4.290.0170.04319.13
5.4.280.0070.08019.16
5.4.270.0100.07319.19
5.4.260.0200.06319.05
5.4.250.0130.07018.93
5.4.240.0170.07019.09
5.4.230.0030.05318.89
5.4.220.0030.08019.20
5.4.210.0170.05719.11
5.4.200.0100.06718.84
5.4.190.0100.07718.86
5.4.180.0070.06019.02
5.4.170.0200.06718.93
5.4.160.0030.08018.87
5.4.150.0100.07718.92
5.4.140.0070.06316.41
5.4.130.0100.06016.49
5.4.120.0030.07316.33
5.4.110.0130.06716.56
5.4.100.0070.04016.39
5.4.90.0170.05016.40
5.4.80.0030.04016.56
5.4.70.0000.04016.54
5.4.60.0000.04716.38
5.4.50.0070.04316.30
5.4.40.0000.04016.50
5.4.30.0000.04016.49
5.4.20.0070.03716.40
5.4.10.0130.02716.29
5.4.00.0100.03315.86
5.3.290.0100.05314.66
5.3.280.0170.06314.57
5.3.270.0070.08014.77
5.3.260.0000.05314.71
5.3.250.0130.06014.59
5.3.240.0030.08714.58
5.3.230.0030.07314.79
5.3.220.0100.05314.55
5.3.210.0070.07714.67
5.3.200.0100.07314.57
5.3.190.0100.05314.72
5.3.180.0030.05014.75
5.3.170.0000.04014.60
5.3.160.0000.04014.67
5.3.150.0170.03014.63
5.3.140.0000.04014.61
5.3.130.0130.05314.66
5.3.120.0100.03314.65
5.3.110.0100.03314.73
5.3.100.0030.05314.07
5.3.90.0000.04314.12
5.3.80.0070.03314.20
5.3.70.0100.03014.07
5.3.60.0030.03714.10
5.3.50.0100.03014.05
5.3.40.0070.03313.90
5.3.30.0000.04014.07
5.3.20.0070.04713.66
5.3.10.0000.04713.76
5.3.00.0070.07313.75
5.2.170.0030.03013.17
5.2.160.0000.03313.17
5.2.150.0070.05013.17
5.2.140.0030.03713.17
5.2.130.0070.05013.17
5.2.120.0070.02713.17
5.2.110.0100.04313.17
5.2.100.0030.04013.17
5.2.90.0030.03313.17
5.2.80.0070.03013.17
5.2.70.0000.07313.17
5.2.60.0070.02713.17
5.2.50.0000.03313.17
5.2.40.0000.03313.17
5.2.30.0000.03013.17
5.2.20.0030.04713.17
5.2.10.0070.03013.17
5.2.00.0030.02713.17
5.1.60.0100.02013.17
5.1.50.0030.02313.17
5.1.40.0030.03013.17
5.1.30.0000.03713.17
5.1.20.0070.02713.17
5.1.10.0000.02713.17
5.1.00.0030.02713.17
5.0.50.0070.02313.17
5.0.40.0030.03713.17
5.0.30.0000.03313.17
5.0.20.0030.02713.17
5.0.10.0030.02713.17
5.0.00.0000.05013.17
4.4.90.0000.01713.17
4.4.80.0000.01713.17
4.4.70.0030.01313.17
4.4.60.0000.02013.17
4.4.50.0000.01713.17
4.4.40.0000.03713.17
4.4.30.0000.01713.17
4.4.20.0000.01713.17
4.4.10.0030.01313.17
4.4.00.0030.02313.17
4.3.110.0000.02313.17
4.3.100.0000.01713.17
4.3.90.0030.01313.17
4.3.80.0000.02713.17
4.3.70.0000.01713.17
4.3.60.0070.01013.17
4.3.50.0030.01313.17
4.3.40.0030.02013.17
4.3.30.0000.01713.17
4.3.20.0000.02013.17
4.3.10.0000.02313.17
4.3.00.0000.02013.17

preferences:
38.87 ms | 400 KiB | 5 Q