3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait setData { static function setData( $data ) { DataCollector::collectedData( 'set', $data ); } } trait dataHandler { use setData; private static function getCollectedData() { DataCollector::collectedData( 'get' ); } private static function collectedData( $type, $value = NULL ) { if( strtolower( $type ) === 'set' ) { DataCollector::$CollectionData[] = $value; var_dump( DataCollector::$CollectionData ); } elseif( strtolower( $type ) === 'get' ) return DataCollector::$CollectionData; } } class DataCollector { use dataHandler { getCollectedData as public; collectedData as public; } private static $CollectionData = array(); } class Field { use setData {} } class TextField extends Field { public function __construct( $type, $text = NULL ) { $this->setData( $type ); } } /* class A { use setData{} public function __construct( $type, $text = NULL ) { $this->setData( $type ); } } */ $Field1 = new TextField( '1' ); $Field2 = new TextField( '2' ); #$A = new A( '3' ); #DataCollector::setData('4'); #dataHandler::setData('5'); var_dump( DataCollector::getCollectedData() );

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.0100.00616.50
8.3.50.0130.00817.22
8.3.40.0160.00018.59
8.3.30.0090.00618.63
8.3.20.0000.00818.73
8.3.10.0040.00418.75
8.3.00.0030.00619.25
8.2.180.0090.00616.38
8.2.170.0170.00322.96
8.2.160.0080.00820.69
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.81
8.2.110.0030.00620.26
8.2.100.0160.00017.91
8.2.90.0090.00017.60
8.2.80.0040.00418.77
8.2.70.0040.00417.63
8.2.60.0040.00417.68
8.2.50.0040.00418.07
8.2.40.0050.00318.29
8.2.30.0050.00218.07
8.2.20.0040.00817.56
8.2.10.0000.00817.63
8.2.00.0030.00617.82
8.1.270.0070.00023.99
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0050.00518.93
8.1.230.0040.00817.83
8.1.220.0030.00617.79
8.1.210.0030.00518.77
8.1.200.0000.00817.22
8.1.190.0050.00317.35
8.1.180.0050.00318.10
8.1.170.0040.00418.56
8.1.160.0040.00418.98
8.1.150.0000.00718.64
8.1.140.0000.00717.33
8.1.130.0030.00317.83
8.1.120.0000.00817.46
8.1.110.0040.00417.50
8.1.100.0000.00817.36
8.1.90.0000.00717.47
8.1.80.0040.00417.48
8.1.70.0000.00717.38
8.1.60.0000.00817.59
8.1.50.0000.00817.43
8.1.40.0040.00417.56
8.1.30.0080.00017.54
8.1.20.0030.00517.60
8.1.10.0000.00717.55
8.1.00.0000.00817.43
8.0.300.0040.00418.77
8.0.290.0080.00016.63
8.0.280.0000.00718.36
8.0.270.0030.00516.73
8.0.260.0000.00716.82
8.0.250.0040.00416.97
8.0.240.0060.00316.95
8.0.230.0030.00316.92
8.0.220.0000.00716.76
8.0.210.0040.00416.95
8.0.200.0030.00316.89
8.0.190.0000.00716.85
8.0.180.0050.00316.83
8.0.170.0030.00616.84
8.0.160.0000.00716.88
8.0.150.0040.00416.96
8.0.140.0040.00416.83
8.0.130.0000.00513.31
8.0.120.0060.00616.83
8.0.110.0040.00416.77
8.0.100.0000.00916.93
8.0.90.0040.00416.91
8.0.80.0060.01316.87
8.0.70.0030.00416.74
8.0.60.0040.00416.77
8.0.50.0040.00416.91
8.0.30.0090.01317.07
8.0.20.0160.00616.87
8.0.10.0040.00416.83
8.0.00.0100.00716.88
7.4.330.0050.00012.98
7.4.320.0000.00616.52
7.4.300.0000.00716.51
7.4.290.0030.00316.49
7.4.280.0000.00816.62
7.4.270.0000.00716.46
7.4.260.0030.00313.32
7.4.250.0000.00916.55
7.4.240.0070.00016.65
7.4.230.0070.00016.44
7.4.220.0030.01216.57
7.4.210.0040.01716.53
7.4.200.0000.00716.59
7.4.190.0000.00816.73
7.4.160.0120.00616.35
7.4.150.0160.00316.62
7.4.140.0110.00716.40
7.4.130.0100.00716.63
7.4.120.0110.00616.38
7.4.110.0110.00716.45
7.4.100.0140.00416.50
7.4.90.0100.00716.61
7.4.80.0150.00316.53
7.4.70.0060.01316.55
7.4.60.0060.01016.67
7.4.50.0000.01116.38
7.4.40.0130.00316.59
7.4.30.0110.00516.55
7.4.00.0070.00715.00
7.3.330.0030.00313.26
7.3.320.0000.00813.27
7.3.310.0080.00016.21
7.3.300.0060.00016.32
7.3.290.0040.01016.30
7.3.280.0060.00916.26
7.3.270.0080.00816.32
7.3.260.0150.00316.45
7.3.250.0140.00616.38
7.3.240.0090.00916.31
7.3.230.0100.00716.36
7.3.210.0030.01316.29
7.3.200.0060.01219.39
7.3.190.0090.00616.29
7.3.180.0080.00816.28
7.3.170.0040.01516.40
7.3.160.0160.00016.32
7.3.120.0040.00814.74
7.3.10.0070.01016.52
7.3.00.0040.01116.50
7.2.330.0150.00316.81
7.2.320.0060.00916.73
7.2.310.0100.01016.83
7.2.300.0090.00916.74
7.2.290.0110.01116.61
7.2.130.0060.00916.64
7.2.120.0000.01416.82
7.2.110.0000.01416.91
7.2.100.0000.01216.94
7.2.90.0080.00817.09
7.2.80.0000.01217.05
7.2.70.0090.00617.15
7.2.60.0030.01016.88
7.2.50.0000.01516.67
7.2.40.0040.01216.88
7.2.30.0100.00717.06
7.2.20.0040.00816.91
7.2.10.0040.01116.84
7.2.00.0030.01018.21
7.1.250.0100.00315.74
7.1.100.0070.00718.15
7.1.70.0050.00217.10
7.1.60.0070.01519.30
7.1.50.0100.01016.85
7.1.00.0070.07322.54
7.0.200.0050.00916.66
7.0.140.0070.07022.14
7.0.120.0000.03322.25
7.0.60.0070.08720.10
7.0.50.0070.03717.86
7.0.40.0100.06020.14
7.0.30.0230.03720.33
7.0.20.0270.06020.25
7.0.10.0100.07720.15
7.0.00.0030.06020.07
5.6.280.0030.07321.05
5.6.210.0000.07720.72
5.6.200.0100.08318.19
5.6.190.0070.06320.50
5.6.180.0270.07720.77
5.6.170.1270.04720.44
5.6.160.0130.07320.49
5.6.150.0070.08018.28
5.6.140.0130.07318.18
5.6.130.0100.05318.15
5.6.120.0000.09020.98
5.6.110.0100.08321.12
5.6.100.0130.07320.99
5.6.90.0070.04020.97
5.6.80.0100.03320.36
5.5.350.0270.07320.39
5.5.340.0070.05318.08
5.5.330.0070.06720.19
5.5.320.0230.07020.32
5.5.310.0230.08720.27
5.5.300.0030.07017.96
5.5.290.0130.06317.93
5.5.280.0100.08020.87
5.5.270.0000.04720.88
5.5.260.0000.10020.89
5.5.250.0100.07720.60
5.5.240.0030.07020.24
5.4.450.0070.05019.18
5.4.440.0030.08019.53
5.4.430.0000.05019.20
5.4.420.0030.04319.58
5.4.410.0100.07319.20
5.4.400.0070.06318.88
5.4.390.0100.05318.87
5.4.380.0070.05719.24
5.4.370.0100.06719.26
5.4.360.0130.07019.24
5.4.350.0170.03719.14
5.4.340.0030.07018.93
5.4.320.0100.07319.08
5.4.310.0100.07718.85
5.4.300.0070.07318.95
5.4.290.0170.06719.23
5.4.280.0000.07019.24
5.4.270.0130.07019.25
5.4.260.0030.05019.20
5.4.250.0100.07319.23
5.4.240.0100.04019.07
5.4.230.0030.05718.91
5.4.220.0030.06318.86
5.4.210.0070.07719.07
5.4.200.0030.04018.97
5.4.190.0030.04318.85
5.4.180.0130.03319.11
5.4.170.0130.04018.88
5.4.160.0070.04319.22
5.4.150.0100.07719.13
5.4.140.0070.07316.41
5.4.130.0000.05716.39
5.4.120.0070.05716.31
5.4.110.0170.03316.72
5.4.100.0130.05016.72
5.4.90.0100.07016.58
5.4.80.0030.03716.45
5.4.70.0030.03716.42
5.4.60.0030.06016.64
5.4.50.0030.08016.45
5.4.40.0170.03316.45
5.4.30.0030.07016.50
5.4.20.0000.06716.40
5.4.10.0000.04316.45
5.4.00.0070.03715.86
5.3.290.0100.07314.54
5.3.280.0130.06714.54
5.3.270.0070.08014.56
5.3.260.0070.08014.50
5.3.250.0030.06714.70
5.3.240.0130.07014.53
5.3.230.0130.04314.68
5.3.220.0070.04314.51
5.3.210.0030.06714.52
5.3.200.0070.03714.50
5.3.190.0130.03714.49
5.3.180.0000.04014.44
5.3.170.0130.03014.65
5.3.160.0070.08014.53
5.3.150.0030.07714.52
5.3.140.0030.05314.48
5.3.130.0070.05314.50
5.3.120.0030.05014.45
5.3.110.0100.04014.45
5.3.100.0030.04314.13
5.3.90.0100.07313.95
5.3.80.0070.05313.97
5.3.70.0030.07713.95
5.3.60.0100.07013.94
5.3.50.0100.06713.88
5.3.40.0030.04013.73
5.3.30.0100.07313.85
5.3.20.0070.05013.50
5.3.10.0070.07313.61
5.3.00.0030.07313.56
5.2.170.0000.06311.12
5.2.160.0100.05711.12
5.2.150.0030.03311.08
5.2.140.0070.04711.14
5.2.130.0000.05310.95
5.2.120.0030.06710.99
5.2.110.0100.06311.04
5.2.100.0000.03311.09
5.2.90.0000.06711.07
5.2.80.0070.04311.08
5.2.70.0070.05311.00
5.2.60.0070.04710.98
5.2.50.0070.04710.91
5.2.40.0070.02710.84
5.2.30.0130.02010.96
5.2.20.0100.05710.95
5.2.10.0000.03010.91
5.2.00.0000.05010.57
5.1.60.0030.0339.84
5.1.50.0070.0409.84
5.1.40.0100.0479.94
5.1.30.0000.04010.20
5.1.20.0130.04710.23
5.1.10.0070.05310.08
5.1.00.0030.05710.06
5.0.50.0000.0308.55
5.0.40.0030.0438.56
5.0.30.0100.0608.55
5.0.20.0030.0238.55
5.0.10.0070.0408.55
5.0.00.0070.0478.55
4.4.90.0030.0338.55
4.4.80.0000.0278.55
4.4.70.0030.0138.55
4.4.60.0030.0178.55
4.4.50.0030.0178.55
4.4.40.0030.0478.55
4.4.30.0000.0408.55
4.4.20.0030.0178.55
4.4.10.0070.0378.55
4.4.00.0030.0278.55
4.3.110.0030.0208.55
4.3.100.0100.0308.55
4.3.90.0030.0178.55
4.3.80.0070.0508.55
4.3.70.0000.0208.55
4.3.60.0100.0238.55
4.3.50.0000.0238.55
4.3.40.0030.0538.55
4.3.30.0000.0278.55
4.3.20.0000.0238.55
4.3.10.0130.0278.55
4.3.00.0000.0238.55

preferences:
57 ms | 400 KiB | 5 Q