3v4l.org

run code in 300+ PHP versions simultaneously
<?php class RegularExpression extends \RecursiveRegexIterator { /** * Get accept status. * * Match the current value or the current key (depends of the flag) against * the regular expression. Please, see the \RegexIterator::accept method. * * Fix https://bugs.php.net/68128. * * @access public * @return bool */ public function accept ( ) { return true === $this->hasChildren() || true === parent::accept(); } } $rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); $rRegexIterator = new RegularExpression($rArrayIterator, '/^test/', RecursiveRegexIterator::ALL_MATCHES); foreach ($rRegexIterator as $key1 => $value1) { if ($rRegexIterator->hasChildren()) { // print all children echo "Children: "; foreach ($rRegexIterator->getChildren() as $key => $value) { echo $value . " "; } echo "\n"; } else { echo "No children\n"; } }

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.0080.01118.80
8.3.50.0140.00622.08
8.3.40.0110.00718.77
8.3.30.0070.00718.96
8.3.20.0040.00420.17
8.3.10.0050.00520.62
8.3.00.0090.00019.49
8.2.180.0180.00416.50
8.2.170.0130.00719.21
8.2.160.0100.01022.96
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0070.00022.18
8.2.110.0030.00619.16
8.2.100.0090.00317.97
8.2.90.0080.00019.27
8.2.80.0080.00017.97
8.2.70.0030.00517.63
8.2.60.0050.00318.03
8.2.50.0060.00318.10
8.2.40.0090.00020.42
8.2.30.0030.00521.17
8.2.20.0060.00317.84
8.2.10.0040.00418.00
8.2.00.0040.00417.94
8.1.280.0140.00725.92
8.1.270.0040.00423.89
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0050.00519.44
8.1.230.0090.00317.64
8.1.220.0040.00417.79
8.1.210.0050.00518.77
8.1.200.0000.00917.48
8.1.190.0050.00817.47
8.1.180.0090.00018.10
8.1.170.0060.00318.96
8.1.160.0070.00018.91
8.1.150.0050.00218.83
8.1.140.0000.00717.50
8.1.130.0070.00017.85
8.1.120.0030.00517.52
8.1.110.0000.00717.57
8.1.100.0070.00017.62
8.1.90.0040.00417.52
8.1.80.0050.00317.63
8.1.70.0050.00217.61
8.1.60.0030.00617.79
8.1.50.0040.00417.69
8.1.40.0000.00817.59
8.1.30.0000.00817.68
8.1.20.0040.00417.83
8.1.10.0000.00817.65
8.1.00.0000.00717.67
8.0.300.0080.00018.77
8.0.290.0040.00416.88
8.0.280.0030.00318.46
8.0.270.0000.00817.14
8.0.260.0040.00417.28
8.0.250.0030.00317.14
8.0.240.0070.00017.23
8.0.230.0000.00717.18
8.0.220.0000.00716.98
8.0.210.0030.00317.07
8.0.200.0000.00817.20
8.0.190.0070.00017.21
8.0.180.0040.00417.18
8.0.170.0060.00317.17
8.0.160.0000.00717.08
8.0.150.0040.00416.97
8.0.140.0000.00716.94
8.0.130.0030.00313.57
8.0.120.0040.00416.97
8.0.110.0040.00416.95
8.0.100.0050.00217.16
8.0.90.0050.00217.05
8.0.80.0060.00917.12
8.0.70.0040.00417.17
8.0.60.0040.00417.09
8.0.50.0000.00716.97
8.0.30.0130.01017.16
8.0.20.0130.00917.40
8.0.10.0000.00917.28
8.0.00.0150.00316.88
7.4.330.0050.00015.17
7.4.320.0070.00016.70
7.4.300.0030.00316.72
7.4.290.0050.00216.73
7.4.280.0030.00616.70
7.4.270.0070.00016.70
7.4.260.0040.00416.68
7.4.250.0030.00616.68
7.4.240.0040.00416.70
7.4.230.0000.00716.63
7.4.220.0120.00616.70
7.4.210.0060.00916.84
7.4.200.0040.00316.90
7.4.160.0050.01116.73
7.4.150.0100.01017.40
7.4.140.0030.01517.86
7.4.130.0090.01316.68
7.4.120.0070.01116.85
7.4.110.0100.00616.79
7.4.100.0110.00716.86
7.4.90.0100.01616.82
7.4.80.0150.00616.61
7.4.70.0090.01216.84
7.4.60.0060.01116.57
7.4.50.0000.00816.81
7.4.40.0140.00716.59
7.4.30.0030.01316.93
7.4.00.0090.00615.12
7.3.330.0050.00013.53
7.3.320.0000.00613.53
7.3.310.0040.00416.55
7.3.300.0030.00316.53
7.3.290.0100.00616.47
7.3.280.0080.00916.49
7.3.270.0120.00617.40
7.3.260.0000.01716.81
7.3.250.0090.01016.61
7.3.240.0030.01416.55
7.3.230.0130.00816.89
7.3.210.0130.00316.87
7.3.200.0000.02019.39
7.3.190.0130.00916.86
7.3.180.0150.00616.70
7.3.170.0090.00916.44
7.3.160.0160.00016.44
7.3.120.0110.00715.33
7.3.110.0030.01715.30
7.3.100.0060.00915.02
7.3.90.0030.00614.95
7.3.80.0090.00615.04
7.3.70.0070.00314.89
7.3.60.0060.01015.12
7.3.50.0060.00314.69
7.3.40.0060.00915.11
7.3.30.0000.01515.18
7.3.20.0030.01216.87
7.3.10.0120.00616.88
7.3.00.0060.00616.96
7.2.330.0130.00716.91
7.2.320.0120.00616.84
7.2.310.0100.00616.94
7.2.300.0030.01316.76
7.2.290.0140.00716.73
7.2.250.0070.01115.02
7.2.240.0030.01414.98
7.2.230.0040.01115.25
7.2.220.0060.00315.12
7.2.210.0070.00715.25
7.2.200.0040.00815.24
7.2.190.0000.01715.23
7.2.180.0040.01115.19
7.2.170.0040.01515.21
7.2.00.0030.01019.52
7.1.330.0100.00715.89
7.1.320.0000.01115.90
7.1.310.0090.00615.92
7.1.300.0080.00016.00
7.1.290.0100.00315.98
7.1.280.0000.01315.89
7.1.270.0060.00615.91
7.1.260.0060.00315.89
7.1.100.0220.00417.85
7.1.70.0070.00317.37
7.1.60.0070.01819.32
7.1.50.0060.01817.12
7.1.00.0000.07722.44
7.0.200.0030.00516.96
7.0.140.0070.07021.92
7.0.60.0100.07319.86
7.0.50.0100.08017.94
7.0.40.0030.05020.28
7.0.30.0230.04720.21
7.0.20.0330.06020.07
7.0.10.0030.09020.32
7.0.00.0100.08020.07
5.6.280.0030.07021.10
5.6.210.0030.08320.63
5.6.200.0070.03718.14
5.6.190.0100.08320.50
5.6.180.0430.04720.41
5.6.170.0400.07720.54
5.6.160.0130.06720.55
5.6.150.0030.05018.16
5.6.140.0130.07718.17
5.6.130.0100.08018.20
5.6.120.0070.03720.95
5.6.110.0070.07021.08
5.6.100.0000.09320.95
5.6.90.0100.08020.98
5.6.80.0030.06720.52
5.5.350.0130.08020.39
5.5.340.0130.04018.08
5.5.330.0030.04320.21
5.5.320.0270.04720.34
5.5.310.0200.08320.30
5.5.300.0000.05318.08
5.5.290.0070.09017.94
5.5.280.0100.08020.91
5.5.270.0030.08020.77
5.5.260.0070.03720.87
5.5.250.0200.07320.70
5.5.240.0170.07020.25
5.4.450.0200.04019.39
5.4.440.0270.06019.32
5.4.430.0230.06319.48
5.4.420.0300.06319.48
5.4.410.0200.05319.19
5.4.400.0230.04319.32
5.4.390.0230.07319.31
5.4.380.0170.07319.32
5.4.370.0270.06719.24
5.4.360.0400.06019.09
5.4.350.0130.05019.06
5.4.340.0170.04319.24
5.4.320.0230.06018.94
5.4.310.0230.06719.31
5.4.300.0270.07018.85
5.4.290.0300.06319.13
5.4.280.0270.07319.05
5.4.270.0270.07018.86
5.4.260.0300.05718.87
5.4.250.0230.07319.16
5.4.240.0230.05019.16
5.4.230.0330.04718.97
5.4.220.0170.03719.14
5.4.210.0170.03718.87
5.4.200.0130.03719.22
5.4.190.0100.04719.04
5.4.180.0100.04019.30
5.4.170.0130.03719.05
5.4.160.0100.04019.06
5.4.150.0100.04018.83
5.4.140.0100.04016.36
5.4.130.0130.03716.50
5.4.120.0200.03716.29
5.4.110.0130.03316.36
5.4.100.0200.03016.46
5.4.90.0170.03316.35
5.4.80.0170.03716.18
5.4.70.0130.03316.39
5.4.60.0170.03016.32
5.4.50.0130.04016.51
5.4.40.0100.04316.51
5.4.30.0170.03016.51
5.4.20.0070.04016.24
5.4.10.0130.03316.50
5.4.00.0170.03715.84
5.3.290.0270.05714.89
5.3.280.0130.04014.59
5.3.270.0130.03714.59
5.3.260.0130.03714.61
5.3.250.0130.03714.79
5.3.240.0130.03714.63
5.3.230.0170.07314.58
5.3.220.0170.03714.57
5.3.210.0170.03314.56
5.3.200.0100.04014.58
5.3.190.0100.04014.48
5.3.180.0170.03314.56
5.3.170.0130.03714.46
5.3.160.0170.03314.61
5.3.150.0130.03714.56
5.3.140.0170.03714.55
5.3.130.0130.04014.53
5.3.120.0070.04714.57
5.3.110.0170.03314.48
5.3.100.0100.04014.06
5.3.90.0100.04313.92
5.3.80.0130.04013.93
5.3.70.0200.03314.00
5.3.60.0200.03314.17
5.3.50.0100.03713.88
5.3.40.0200.03014.07
5.3.30.0130.03313.82
5.3.20.0100.04013.71
5.3.10.0230.04013.59
5.3.00.0200.03313.57
5.2.170.0130.03312.12
5.2.160.0100.03012.12
5.2.150.0130.02712.12
5.2.140.0170.02712.12
5.2.130.0200.03712.12
5.2.120.0230.05712.12
5.2.110.0170.05712.12
5.2.100.0200.05712.12
5.2.90.0170.03012.12
5.2.80.0130.06712.12
5.2.70.0170.06312.12
5.2.60.0200.05012.12
5.2.50.0330.04312.12
5.2.40.0170.05712.12
5.2.30.0170.05712.12
5.2.20.0270.05312.12
5.2.10.0200.04712.12
5.2.00.0100.04312.12
5.1.60.0170.05012.12
5.1.50.0170.05012.12
5.1.40.0200.04312.12
5.1.30.0170.04012.12
5.1.20.0170.05712.12
5.1.10.0200.05312.12
5.1.00.0130.04312.12
5.0.50.0100.04712.12
5.0.40.0070.04712.12
5.0.30.0130.06012.12
5.0.20.0170.03312.12
5.0.10.0070.04312.12
5.0.00.0030.05012.12
4.4.90.0130.03012.12
4.4.80.0100.03312.12
4.4.70.0100.02012.12
4.4.60.0100.03012.12
4.4.50.0100.03312.12
4.4.40.0070.05712.12
4.4.30.0130.03312.12
4.4.20.0130.01012.12
4.4.10.0100.02312.12
4.4.00.0130.04312.12
4.3.110.0070.02312.12
4.3.100.0130.02712.12
4.3.90.0030.02712.12
4.3.80.0100.05012.12
4.3.70.0070.02312.12
4.3.60.0070.03312.12
4.3.50.0100.03312.12
4.3.40.0070.05012.12
4.3.30.0070.02312.12
4.3.20.0030.03712.12
4.3.10.0030.03312.12
4.3.00.0100.02712.12

preferences:
35.29 ms | 400 KiB | 5 Q