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() { return 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 Form { use setData {} } class Field extends Form { public function __construct( $type, $text = NULL ) { $this->setData( $type ); } } class A { use setData{} public function __construct( $type, $text = NULL ) { $this->setData( $type ); } } $Field1 = new Field( '1' ); $Field2 = new Field( '2' ); $A = new A( '3' ); DataCollector::setData('4'); dataHandler::setData('5'); var_dump( $A::getCollectedData(), 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.0190.00018.43
8.3.50.0100.01016.48
8.3.40.0040.01218.84
8.3.30.0040.01118.93
8.3.20.0050.00318.91
8.3.10.0040.00418.95
8.3.00.0040.00419.25
8.2.180.0120.00318.67
8.2.170.0040.01122.96
8.2.160.0150.00019.02
8.2.150.0000.00924.18
8.2.140.0090.00024.66
8.2.130.0030.00526.16
8.2.120.0040.00421.19
8.2.110.0040.01119.21
8.2.100.0040.01217.84
8.2.90.0080.00017.75
8.2.80.0040.00417.97
8.2.70.0040.00418.05
8.2.60.0030.00618.22
8.2.50.0040.00418.10
8.2.40.0050.00319.30
8.2.30.0040.00419.41
8.2.20.0050.00517.83
8.2.10.0040.00417.93
8.2.00.0000.00817.92
8.1.280.0070.01025.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0060.00322.23
8.1.230.0060.00622.18
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0050.00517.25
8.1.190.0030.00517.35
8.1.180.0030.00618.10
8.1.170.0000.00818.64
8.1.160.0050.00318.96
8.1.150.0080.00018.87
8.1.140.0030.00617.44
8.1.130.0040.00417.45
8.1.120.0040.00417.40
8.1.110.0040.00417.49
8.1.100.0000.00717.52
8.1.90.0030.00517.50
8.1.80.0000.00717.52
8.1.70.0030.00317.38
8.1.60.0030.00617.66
8.1.50.0000.00817.38
8.1.40.0070.00317.59
8.1.30.0030.00517.70
8.1.20.0040.00417.61
8.1.10.0040.00417.61
8.1.00.0000.00817.54
8.0.300.0000.00718.77
8.0.290.0090.00016.88
8.0.280.0000.00718.48
8.0.270.0000.00717.32
8.0.260.0000.00716.93
8.0.250.0040.00417.09
8.0.240.0080.00017.07
8.0.230.0000.00716.93
8.0.220.0040.00416.89
8.0.210.0000.00716.90
8.0.200.0000.00716.99
8.0.190.0090.00017.04
8.0.180.0050.00317.00
8.0.170.0070.00417.00
8.0.160.0050.00217.04
8.0.150.0040.00416.79
8.0.140.0100.00316.95
8.0.130.0000.00613.38
8.0.120.0000.00917.04
8.0.110.0000.00917.02
8.0.100.0000.00717.11
8.0.90.0040.00416.86
8.0.80.0040.01116.96
8.0.70.0070.00017.04
8.0.60.0030.00516.94
8.0.50.0000.00916.88
8.0.30.0110.00717.16
8.0.20.0120.00917.13
8.0.10.0000.00716.93
8.0.00.0140.00716.77
7.4.330.0000.00613.05
7.4.320.0070.00016.56
7.4.300.0060.00016.69
7.4.290.0000.00716.53
7.4.280.0070.00016.47
7.4.270.0040.00416.53
7.4.260.0000.00513.38
7.4.250.0030.00516.50
7.4.240.0030.00316.65
7.4.230.0000.00716.38
7.4.220.0100.01616.44
7.4.210.0100.00616.59
7.4.200.0040.00416.45
7.4.190.0030.00616.50
7.4.160.0120.00416.53
7.4.150.0150.00416.73
7.4.140.0130.01017.86
7.4.130.0100.01316.56
7.4.120.0030.01416.47
7.4.110.0160.00316.71
7.4.100.0080.01016.47
7.4.90.0110.00716.75
7.4.80.0120.00619.39
7.4.70.0130.01016.58
7.4.60.0070.01116.62
7.4.50.0030.00616.42
7.4.40.0070.00516.61
7.4.30.0060.01216.63
7.4.00.0060.00914.85
7.3.330.0040.00413.31
7.3.320.0000.00513.40
7.3.310.0070.00016.40
7.3.300.0030.00316.41
7.3.290.0050.01016.43
7.3.280.0060.01316.38
7.3.270.0080.01116.34
7.3.260.0130.01016.45
7.3.240.0110.00516.40
7.3.230.0160.00516.42
7.3.210.0090.00916.53
7.3.200.0170.00316.40
7.3.190.0180.00316.56
7.3.180.0060.00916.64
7.3.170.0060.01116.34
7.3.160.0060.01016.35
7.3.120.0070.00714.67
7.2.330.0090.01016.70
7.2.320.0030.01416.77
7.2.310.0180.00716.73
7.2.300.0170.00016.60
7.2.290.0120.00816.66
7.2.60.0070.00717.08
7.1.200.0100.00315.65
7.1.100.0040.00718.41
7.1.70.0000.01017.22
7.1.60.0120.01219.25
7.1.50.0140.00717.04
7.1.00.0100.06722.24
7.0.200.0090.00316.81
7.0.140.0000.08021.98
7.0.120.0030.07022.17
7.0.60.0170.07320.07
7.0.50.0100.08017.75
7.0.40.0100.08020.09
7.0.30.0300.07320.33
7.0.20.0270.03320.19
7.0.10.0230.07320.21
7.0.00.0030.04020.31
5.6.210.0100.04720.48
5.6.200.0030.05018.19
5.6.190.0100.08320.46
5.6.180.0300.06020.58
5.6.170.0170.05320.50
5.6.160.0170.07720.71
5.6.150.0030.08718.27
5.6.140.0070.06018.18
5.6.130.0100.07718.28
5.6.120.0030.04021.15
5.6.110.0170.07721.03
5.6.100.0070.07720.95
5.6.90.0130.08720.96
5.6.80.0070.04720.30
5.6.70.4370.04020.40
5.5.350.0200.08320.34
5.5.340.0030.08318.04
5.5.330.0030.07320.13
5.5.320.0230.07720.25
5.5.310.0370.07720.32
5.5.300.0130.07717.93
5.5.290.0000.04717.95
5.5.280.0300.02320.90
5.5.270.0070.05720.88
5.5.260.0100.07720.89
5.5.250.0100.06320.59
5.5.240.0030.04020.08
5.4.450.0100.07019.18
5.4.440.0070.07719.30
5.4.430.0030.07719.53
5.4.420.0000.05019.16
5.4.410.0100.03719.34
5.4.400.0030.04719.16
5.4.390.0030.04019.05
5.4.380.0100.03319.24
5.4.370.0070.04319.08
5.4.360.0100.07319.08
5.4.350.0100.07019.16
5.4.340.0030.07719.24
5.4.320.0070.04719.12
5.4.310.0100.05019.25
5.4.300.0170.05718.85
5.4.290.0070.03719.20
5.4.280.0130.05719.24
5.4.270.0070.04018.85
5.4.260.0030.04019.00
5.4.250.0030.08019.14
5.4.240.0100.03319.11
5.4.230.0030.04018.92
5.4.220.0070.07319.13
5.4.210.0100.04018.87
5.4.200.0070.06319.13
5.4.190.0100.06019.06
5.4.180.0100.07018.86
5.4.170.0070.05019.15
5.4.160.0000.05319.13
5.4.150.0000.04319.04
5.4.140.0100.03316.46
5.4.130.0030.06316.45
5.4.120.0070.07716.45
5.4.110.0130.06016.50
5.4.100.0030.07316.55
5.4.90.0130.05316.50
5.4.80.0030.04316.46
5.4.70.0030.04316.46
5.4.60.0030.06016.31
5.4.50.0100.07016.31
5.4.40.0070.07316.52
5.4.30.0100.06716.41
5.4.20.0130.05716.44
5.4.10.0030.07716.38
5.4.00.0070.05715.88
5.3.290.0100.09014.59
5.3.280.0070.07014.57
5.3.270.0070.05714.43
5.3.260.0000.05314.49
5.3.250.0000.04314.53
5.3.240.0030.07714.54
5.3.230.0130.05714.55
5.3.220.0070.07314.41
5.3.210.0070.06014.50
5.3.200.0100.06014.50
5.3.190.0130.03714.66
5.3.180.0070.07014.53
5.3.170.0070.06014.49
5.3.160.0000.08314.50
5.3.150.0170.06314.51
5.3.140.0130.06714.43
5.3.130.0130.07014.48
5.3.120.0070.06714.34
5.3.110.0070.04714.34
5.3.100.0030.03714.13
5.3.90.0170.03713.96
5.3.80.0030.04713.95
5.3.70.0030.03713.94
5.3.60.0000.04013.92
5.3.50.0170.02314.03
5.3.40.0000.06014.04
5.3.30.0030.06313.87
5.3.20.0130.07013.63
5.3.10.0030.07713.57
5.3.00.0100.04013.59
5.2.170.0030.06311.13
5.2.160.0030.04311.09
5.2.150.0100.05711.03
5.2.140.0070.06011.07
5.2.130.0170.05310.95
5.2.120.0100.05711.09
5.2.110.0000.06311.25
5.2.100.0070.05711.09
5.2.90.0070.03011.09
5.2.80.0030.03011.06
5.2.70.0030.04310.98
5.2.60.0030.05310.87
5.2.50.0030.03310.89
5.2.40.0030.03010.81
5.2.30.0070.04310.90
5.2.20.0070.03710.94
5.2.10.0000.05310.85
5.2.00.0000.05310.79
5.1.60.0070.0539.95
5.1.50.0030.0379.99
5.1.40.0030.0379.99
5.1.30.0030.05710.38
5.1.20.0000.04310.35
5.1.10.0000.03010.13
5.1.00.0070.04710.11
5.0.50.0070.0438.52
5.0.40.0000.0278.43
5.0.30.0030.0538.20
5.0.20.0030.0478.14
5.0.10.0000.0338.32
5.0.00.0030.0338.31
4.4.90.0070.0307.82
4.4.80.0070.0237.82
4.4.70.0000.0177.82
4.4.60.0000.0407.82
4.4.50.0000.0407.82
4.4.40.0070.0507.82
4.4.30.0000.0207.82
4.4.20.0070.0307.82
4.4.10.0030.0137.82
4.4.00.0000.0577.82
4.3.110.0030.0277.82
4.3.100.0000.0207.82
4.3.90.0000.0277.82
4.3.80.0030.0237.82
4.3.70.0030.0137.82
4.3.60.0000.0207.82
4.3.50.0000.0207.82
4.3.40.0000.0307.82
4.3.30.0030.0377.82
4.3.20.0000.0407.82
4.3.10.0000.0177.82
4.3.00.0070.0277.82

preferences:
48.05 ms | 401 KiB | 5 Q