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('/in'); $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.60.0150.00318.43
8.3.50.0130.00322.05
8.3.40.0070.00718.84
8.3.30.0130.00318.84
8.3.20.0000.00818.69
8.3.10.0040.00421.09
8.3.00.0050.00323.48
8.2.180.0040.01118.56
8.2.170.0180.00322.96
8.2.160.0030.01020.41
8.2.150.0030.00624.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0080.00019.36
8.2.110.0120.00021.02
8.2.100.0060.00617.71
8.2.90.0030.00619.20
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0000.00817.63
8.2.50.0050.00618.07
8.2.40.0000.00818.06
8.2.30.0000.00819.92
8.2.20.0040.00417.66
8.2.10.0070.00017.70
8.2.00.0040.00417.79
8.1.280.0090.01225.92
8.1.270.0040.00423.99
8.1.260.0090.00926.35
8.1.250.0000.00728.09
8.1.240.0070.00323.86
8.1.230.0000.01220.97
8.1.220.0040.00417.89
8.1.210.0040.00418.77
8.1.200.0000.00917.48
8.1.190.0030.00617.66
8.1.180.0000.00818.10
8.1.170.0040.00418.79
8.1.160.0040.00418.84
8.1.150.0000.00718.63
8.1.140.0000.00817.40
8.1.130.0030.00317.95
8.1.120.0000.00817.58
8.1.110.0040.00417.49
8.1.100.0040.00417.59
8.1.90.0040.00417.52
8.1.80.0050.00317.55
8.1.70.0000.00717.44
8.1.60.0050.00317.67
8.1.50.0030.00517.51
8.1.40.0070.00017.53
8.1.30.0000.00817.60
8.1.20.0030.00517.60
8.1.10.0050.00217.68
8.1.00.0000.00817.47
8.0.300.0080.00018.77
8.0.290.0040.00416.88
8.0.280.0070.00018.44
8.0.270.0030.00516.86
8.0.260.0000.00816.89
8.0.250.0070.00016.93
8.0.240.0030.00616.93
8.0.230.0080.00017.02
8.0.220.0000.00716.95
8.0.210.0070.00016.94
8.0.200.0060.00316.96
8.0.190.0000.00717.04
8.0.180.0040.00416.92
8.0.170.0000.00817.05
8.0.160.0000.00716.98
8.0.150.0080.00016.88
8.0.140.0080.00016.92
8.0.130.0000.00713.42
8.0.120.0000.00816.88
8.0.110.0000.00816.96
8.0.100.0040.00416.83
8.0.90.0000.00816.94
8.0.80.0090.00616.96
8.0.70.0070.00016.87
8.0.60.0050.00316.86
8.0.50.0000.00716.96
8.0.30.0100.00917.23
8.0.20.0140.00917.40
8.0.10.0050.00317.04
8.0.00.0080.01016.79
7.4.330.0050.00014.69
7.4.320.0030.00316.69
7.4.300.0000.00616.59
7.4.290.0000.00716.54
7.4.280.0070.00016.52
7.4.270.0040.00416.59
7.4.260.0070.00013.36
7.4.250.0000.00816.36
7.4.240.0080.00016.39
7.4.230.0040.00416.49
7.4.220.0150.00916.54
7.4.210.0070.00916.59
7.4.200.0000.00716.63
7.4.190.0040.00416.46
7.4.160.0060.01016.33
7.4.150.0120.00617.40
7.4.140.0140.01217.86
7.4.130.0100.01016.64
7.4.120.0050.01416.61
7.4.110.0080.00916.47
7.4.100.0070.01516.61
7.4.90.0040.01416.46
7.4.80.0150.00319.37
7.4.70.0060.01216.41
7.4.60.0030.01516.42
7.4.50.0030.00716.50
7.4.40.0070.01022.52
7.4.30.0120.00616.49
7.4.00.0070.00714.75
7.3.330.0020.00313.22
7.3.320.0000.00713.43
7.3.310.0030.00316.55
7.3.300.0050.00216.51
7.3.290.0090.00616.48
7.3.280.0110.00816.46
7.3.270.0150.00317.40
7.3.260.0130.00518.24
7.3.250.0100.01016.42
7.3.240.0110.00716.56
7.3.230.0090.00916.55
7.3.210.0090.01016.58
7.3.200.0090.00919.39
7.3.190.0140.00316.61
7.3.180.0120.00316.52
7.3.170.0080.00816.48
7.3.160.0040.01216.71
7.3.120.0070.00714.87
7.2.330.0130.01316.87
7.2.320.0120.00616.63
7.2.310.0150.00316.84
7.2.300.0130.00416.89
7.2.290.0090.01616.55
7.2.60.0040.01116.94
7.1.200.0060.00915.61
7.1.100.0040.00718.18
7.1.70.0070.00316.87
7.1.60.0130.01019.40
7.1.50.0100.01716.75
7.1.00.0030.05022.48
7.0.200.0000.00716.62
7.0.140.0030.07022.09
7.0.70.0000.04021.70
7.0.60.0000.04021.73
7.0.50.0000.03722.03
7.0.40.0030.03020.16
7.0.30.0030.04020.06
7.0.20.0030.04320.11
7.0.10.0000.04720.15
7.0.00.0030.04320.03
5.6.280.0000.07720.97
5.6.220.0000.04320.75
5.6.210.0000.04020.61
5.6.200.0030.03321.08
5.6.190.0000.03321.17
5.6.180.0000.03321.09
5.6.170.0030.03720.99
5.6.160.0030.04321.04
5.6.150.0030.03321.11
5.6.140.0030.03321.17
5.6.130.0000.03721.06
5.6.120.0000.03720.99
5.6.110.0070.03021.11
5.6.100.0030.03020.98
5.6.90.0030.03321.04
5.6.80.0000.03320.46
5.6.70.0000.03320.51
5.6.60.0000.03720.49
5.6.50.0030.03020.50
5.6.40.0000.03720.35
5.6.30.0000.04720.35
5.6.20.0030.04020.41
5.6.10.0000.05020.41
5.6.00.0070.07020.31
5.5.360.0070.03720.44
5.5.350.0000.04720.41
5.5.340.0000.04020.80
5.5.330.0000.03320.82
5.5.320.0000.03320.94
5.5.310.0000.04720.91
5.5.300.0000.03320.94
5.5.290.0070.06320.84
5.5.280.0000.03720.88
5.5.270.0000.03320.96
5.5.260.0000.04020.67
5.5.250.0030.04020.77
5.5.240.0070.02720.29
5.5.230.0000.03320.30
5.5.220.0030.04020.24
5.5.210.0000.03320.34
5.5.200.0000.03320.32
5.5.190.0000.04320.03
5.5.180.0030.04020.32
5.5.160.0070.06320.13
5.5.150.0070.08320.28
5.5.140.0070.07720.24
5.5.130.0030.08020.29
5.5.120.0130.06020.27
5.5.110.0070.08320.24
5.5.100.0030.07720.12
5.5.90.0070.06319.95
5.5.80.0100.07720.01
5.5.70.0070.07320.09
5.5.60.0030.06020.09
5.5.50.0070.07720.17
5.5.40.0070.07320.09
5.5.30.0100.07720.08
5.5.20.0030.07320.11
5.5.10.0000.04020.02
5.5.00.0130.05319.98
5.4.450.0000.03319.50
5.4.440.0030.03019.21
5.4.430.0000.03319.25
5.4.420.0030.03019.43
5.4.410.0000.03319.24
5.4.400.0000.03019.17
5.4.390.0000.03318.86
5.4.380.0030.03719.03
5.4.370.0000.03719.01
5.4.360.0000.03319.20
5.4.350.0070.02719.04
5.4.340.0000.08018.95
5.4.320.0000.04319.15
5.4.310.0030.08319.21
5.4.300.0070.07319.14
5.4.290.0070.08018.86
5.4.280.0030.08019.11
5.4.270.0030.07719.10
5.4.260.0000.07319.16
5.4.250.0030.05319.07
5.4.240.0000.06018.92
5.4.230.0100.06319.20
5.4.220.0000.09019.12
5.4.210.0070.07319.14
5.4.200.0030.07019.02
5.4.190.0030.07318.88
5.4.180.0000.06019.11
5.4.170.0100.06719.03
5.4.160.0000.08019.14
5.4.150.0070.03319.14
5.4.140.0000.04016.50
5.4.130.0030.03316.48
5.4.120.0000.03716.44
5.4.110.0070.07316.47
5.4.100.0100.07016.48
5.4.90.0070.07016.39
5.4.80.0030.07316.46
5.4.70.0000.05016.37
5.4.60.0030.06316.52
5.4.50.0000.04716.40
5.4.40.0030.07316.51
5.4.30.0030.06316.36
5.4.20.0000.05016.44
5.4.10.0000.06016.52
5.4.00.0030.05315.91
5.3.290.0000.08014.64
5.3.280.0000.07314.68
5.3.270.0000.06314.72
5.3.260.0000.04014.68
5.3.250.0070.03314.71
5.3.240.0030.06714.71
5.3.230.0000.05014.77
5.3.220.0000.05714.70
5.3.210.0070.07714.63
5.3.200.0000.04714.63
5.3.190.0070.07314.76
5.3.180.0000.06714.56
5.3.170.0000.07714.63
5.3.160.0030.05014.54
5.3.150.0000.07714.61
5.3.140.0030.05314.55
5.3.130.0030.07714.58
5.3.120.0070.05714.63
5.3.110.0000.04714.60
5.3.100.0070.03014.15
5.3.90.0070.03014.19
5.3.80.0000.05014.00
5.3.70.0030.03714.17
5.3.60.0030.04314.12
5.3.50.0000.05014.12
5.3.40.0000.04713.92
5.3.30.0030.04313.95
5.3.20.0000.03713.80
5.3.10.0000.05313.71
5.3.00.0030.05713.75
5.2.170.0000.06311.20
5.2.160.0000.03311.20
5.2.150.0000.03011.21
5.2.140.0000.03711.20
5.2.130.0000.03711.20
5.2.120.0030.02711.20
5.2.110.0000.03711.20
5.2.100.0000.03011.20
5.2.90.0030.03011.20
5.2.80.0000.03011.20
5.2.70.0030.02711.20
5.2.60.0030.02711.20
5.2.50.0030.03011.20
5.2.40.0000.02711.20
5.2.30.0070.02311.20
5.2.20.0000.03011.20
5.2.10.0030.06011.20
5.2.00.0070.02311.20
5.1.60.0000.05311.20
5.1.50.0000.04311.20
5.1.40.0000.03011.20
5.1.30.0000.02711.20
5.1.20.0030.02711.20
5.1.10.0070.04711.20
5.1.00.0000.03011.20
5.0.50.0030.02711.20
5.0.40.0030.04711.20
5.0.30.0000.06711.20
5.0.20.0030.04011.20
5.0.10.0100.03711.20
5.0.00.0030.07011.20
4.4.90.0000.01311.20
4.4.80.0000.01711.20
4.4.70.0000.01311.20
4.4.60.0000.01711.20
4.4.50.0030.01311.20
4.4.40.0000.04711.20
4.4.30.0000.02311.20
4.4.20.0000.01711.20
4.4.10.0000.03711.20
4.4.00.0000.02711.20
4.3.110.0030.02311.20
4.3.100.0030.03011.20
4.3.90.0030.03011.20
4.3.80.0000.05711.20
4.3.70.0000.03011.20
4.3.60.0100.02011.20
4.3.50.0070.02711.20
4.3.40.0000.05011.20
4.3.30.0000.04011.20
4.3.20.0030.02711.20
4.3.10.0000.03711.20
4.3.00.0070.02011.20

preferences:
45.18 ms | 400 KiB | 5 Q