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.60.0090.00918.40
8.3.50.0140.00522.11
8.3.40.0070.01118.84
8.3.30.0120.00318.84
8.3.20.0150.00418.45
8.3.10.0030.00520.92
8.3.00.0060.00321.90
8.2.180.0070.00717.00
8.2.170.0100.00322.96
8.2.160.0070.00722.00
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00421.04
8.2.110.0040.00420.27
8.2.100.0110.00017.84
8.2.90.0030.00519.23
8.2.80.0040.00417.97
8.2.70.0040.00717.63
8.2.60.0040.00417.93
8.2.50.0040.00718.07
8.2.40.0050.00318.16
8.2.30.0000.01019.47
8.2.20.0080.00017.69
8.2.10.0000.00717.74
8.2.00.0080.00017.66
8.1.280.0130.00725.92
8.1.270.0150.00023.99
8.1.260.0080.00026.35
8.1.250.0000.00928.09
8.1.240.0030.00722.42
8.1.230.0080.00320.89
8.1.220.0000.00818.77
8.1.210.0040.00418.82
8.1.200.0060.00317.35
8.1.190.0050.00317.41
8.1.180.0080.00018.10
8.1.170.0000.00818.46
8.1.160.0000.00718.75
8.1.150.0040.00418.46
8.1.140.0000.00817.28
8.1.130.0000.00717.69
8.1.120.0000.00817.41
8.1.110.0000.00717.36
8.1.100.0040.00417.42
8.1.90.0040.00417.27
8.1.80.0030.00517.41
8.1.70.0080.00017.40
8.1.60.0030.00617.54
8.1.50.0050.00317.45
8.1.40.0040.00417.49
8.1.30.0040.00417.46
8.1.20.0000.00817.62
8.1.10.0080.00017.58
8.1.00.0040.00817.57
8.0.300.0020.00519.95
8.0.290.0030.00617.16
8.0.280.0030.00518.40
8.0.270.0040.00417.16
8.0.260.0000.00716.87
8.0.250.0070.00016.92
8.0.240.0080.00416.87
8.0.230.0000.00716.89
8.0.220.0000.00717.00
8.0.210.0000.00716.83
8.0.200.0030.00317.02
8.0.190.0050.00316.91
8.0.180.0040.00416.92
8.0.170.0080.00016.86
8.0.160.0030.00317.02
8.0.150.0030.00516.77
8.0.140.0030.00516.93
8.0.130.0060.00013.52
8.0.120.0040.00416.95
8.0.110.0000.00916.98
8.0.100.0000.00716.96
8.0.90.0000.00916.90
8.0.80.0090.01216.94
8.0.70.0040.00416.76
8.0.60.0080.00016.80
8.0.50.0050.00216.82
8.0.30.0070.01217.06
8.0.20.0110.00717.40
8.0.10.0000.00716.87
8.0.00.0090.00816.69
7.4.330.0060.00016.85
7.4.320.0000.00616.58
7.4.300.0030.00316.50
7.4.290.0000.00716.56
7.4.280.0050.00316.48
7.4.270.0030.00316.60
7.4.260.0030.00313.39
7.4.250.0070.00016.45
7.4.240.0000.00716.48
7.4.230.0000.00816.59
7.4.220.0070.01016.40
7.4.210.0080.00816.54
7.4.200.0080.00016.69
7.4.190.0070.00016.35
7.4.160.0030.01916.72
7.4.150.0070.01017.40
7.4.140.0050.01317.86
7.4.130.0110.00716.55
7.4.120.0090.00916.59
7.4.110.0090.01116.46
7.4.100.0050.01416.50
7.4.90.0070.01716.56
7.4.80.0080.00819.39
7.4.70.0040.01216.46
7.4.60.0160.00516.53
7.4.50.0060.00316.50
7.4.40.0000.01222.77
7.4.30.0100.01016.30
7.4.00.0060.01015.16
7.3.330.0030.00313.57
7.3.320.0000.00813.52
7.3.310.0000.00716.52
7.3.300.0070.00016.54
7.3.290.0030.01016.46
7.3.280.0110.00616.45
7.3.270.0130.00317.40
7.3.260.0130.00618.24
7.3.250.0060.01116.43
7.3.240.0100.00616.36
7.3.230.0120.00616.51
7.3.210.0160.00316.50
7.3.200.0060.01219.39
7.3.190.0070.01016.35
7.3.180.0140.00516.51
7.3.170.0070.01116.50
7.3.160.0080.00816.50
7.3.120.0100.00714.95
7.2.330.0100.00716.72
7.2.320.0090.01216.50
7.2.310.0070.01116.61
7.2.300.0000.01616.71
7.2.290.0080.00816.48
7.2.60.0100.00316.91
7.2.00.0060.00619.35
7.1.200.0000.00815.85
7.1.100.0050.00517.81
7.1.70.0070.00017.22
7.1.60.0070.01819.40
7.1.50.0270.00734.86
7.1.00.0030.06722.36
7.0.200.0030.00616.79
7.0.140.0030.07322.13
7.0.60.0170.07019.95
7.0.50.0200.06717.98
7.0.40.0030.05020.09
7.0.30.0300.08020.25
7.0.20.0370.06320.24
7.0.10.0100.05720.07
7.0.00.0100.06020.25
5.6.280.0000.07720.87
5.6.210.0100.07720.71
5.6.200.0100.08318.28
5.6.190.0000.07020.51
5.6.180.0330.05020.52
5.6.170.0200.05720.50
5.6.160.0070.08020.50
5.6.150.0070.08018.19
5.6.140.0100.04718.18
5.6.130.0070.07018.18
5.6.120.0100.06721.04
5.6.110.0130.03321.05
5.6.100.0100.08021.17
5.6.90.0070.05321.13
5.6.80.0100.08020.43
5.5.350.0030.05720.45
5.5.340.0030.03718.09
5.5.330.0000.05320.42
5.5.320.1500.05320.30
5.5.310.0370.07020.28
5.5.300.0070.06717.96
5.5.290.0130.07018.06
5.5.280.0230.07020.84
5.5.270.0170.07321.00
5.5.260.0170.07020.81
5.5.250.0170.07720.52
5.5.240.0070.05720.37
5.4.450.0700.05021.50
5.4.440.0370.04321.50
5.4.430.0400.05021.50
5.4.420.0570.04721.50
5.4.410.0500.04321.50
5.4.400.0870.02321.50
5.4.390.0400.04021.50
5.4.380.0470.04021.50
5.4.370.0470.04721.50
5.4.360.0630.04021.50
5.4.350.0900.03721.50
5.4.340.0900.03321.50
5.4.320.0570.04721.50
5.4.310.0670.04021.50
5.4.300.0270.04021.50
5.4.290.0730.04321.50
5.4.280.0700.04021.49
5.4.270.0730.03721.49
5.4.260.0530.04021.49
5.4.250.0500.04721.49
5.4.240.0200.04321.49
5.4.230.0200.05321.49
5.4.220.0730.04021.49
5.4.210.0430.04321.49
5.4.200.0200.04721.49
5.4.190.0800.03721.49
5.4.180.0500.04321.49
5.4.170.1030.03721.49
5.4.160.0630.04021.49
5.4.150.0470.05721.49
5.4.140.0570.04021.49
5.4.130.0300.05321.49
5.4.120.0430.03721.49
5.4.110.0670.04021.49
5.4.100.0670.03721.49
5.4.90.0430.04021.49
5.4.80.0870.02721.49
5.4.70.0800.02721.49
5.4.60.0930.03021.49
5.4.50.0870.03021.49
5.4.40.0730.02321.49
5.4.30.0330.04021.49
5.4.20.0170.04021.49
5.4.10.0370.03721.49
5.4.00.0770.02321.49
5.3.290.0300.04021.50
5.3.280.0670.03321.49
5.3.270.0370.08321.49
5.3.260.0630.04021.49
5.3.250.0570.03721.49
5.3.240.0300.03021.49
5.3.230.0600.04321.49
5.3.220.0370.03321.49
5.3.210.0800.04321.49
5.3.200.0600.05021.49
5.3.190.0630.04721.49
5.3.180.0770.02021.49
5.3.170.0930.03021.49
5.3.160.0870.03321.49
5.3.150.1070.02321.49
5.3.140.0630.04021.49
5.3.130.0470.04321.49
5.3.120.0330.04321.49
5.3.110.0870.04321.49
5.3.100.0830.03021.49
5.3.90.0370.04021.49
5.3.80.0530.03721.49
5.3.70.0170.05321.49
5.3.60.0400.04021.49
5.3.50.0770.04021.49
5.3.40.0330.04321.49
5.3.30.1030.02321.49
5.3.20.0630.04021.49
5.3.10.0570.04321.49
5.3.00.0400.03321.49
5.2.170.0470.03721.49
5.2.160.0470.03321.49
5.2.150.0470.03321.49
5.2.140.0700.03721.49
5.2.130.0670.03021.49
5.2.120.0330.03321.49
5.2.110.0700.03321.49
5.2.100.0770.03021.49
5.2.90.0570.03721.49
5.2.80.0730.02321.49
5.2.70.0600.02721.49
5.2.60.0200.03321.49
5.2.50.0200.03021.49
5.2.40.0270.02721.49
5.2.30.0430.02321.49
5.2.20.0200.02721.63
5.2.10.0400.03721.63
5.2.00.0200.02721.63
5.1.60.0400.02721.63
5.1.50.0330.02321.63
5.1.40.0370.02321.63
5.1.30.0530.02021.63
5.1.20.0700.02021.63
5.1.10.0500.02321.63
5.1.00.0270.03321.63
5.0.50.0100.01721.63
5.0.40.0300.02021.63
5.0.30.0230.02721.63
5.0.20.0270.01321.63
5.0.10.0030.02721.63
5.0.00.0130.03021.63
4.4.90.0070.03021.49
4.4.80.0100.01321.49
4.4.70.0300.01721.63
4.4.60.0130.02321.63
4.4.50.0170.01321.63
4.4.40.0270.02021.62
4.4.30.0070.01721.63
4.4.20.0230.01721.63
4.4.10.0270.02321.63
4.4.00.0230.01721.63
4.3.110.0170.01721.63
4.3.100.0130.01321.63
4.3.90.0200.02321.63
4.3.80.0230.02021.63
4.3.70.0200.01721.63
4.3.60.0100.01321.63
4.3.50.0330.02021.63
4.3.40.0130.02721.63
4.3.30.0030.01321.63
4.3.20.0170.01021.63
4.3.10.0070.02021.63
4.3.00.0100.01321.63

preferences:
39.91 ms | 401 KiB | 5 Q