3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait DataCollector { static function setData( $data ) { DataCollector::collectedData( 'set', $data ); } private static function collectedData( $type, $value = NULL ) { static $CollectionData = array(); if( strtolower( $type ) === 'set' ) { $CollectionData[] = $value; var_dump($CollectionData); } elseif( strtolower( $type ) === 'get' ) var_dump($CollectionData); } private static function getCollectedData() { DataCollector::collectedData( 'get' ); } } trait dataHandler { use DataCollector { getCollectedData as public; } } class Form { use DataCollector {} } class Field extends Form { public function __construct( $type, $text = NULL ) { DataCollector::setData( $type ); } } class A { use DataCollector{} public function __construct( $type, $text = NULL ) { DataCollector::setData( $type ); } } $Field1 = new Field( '1' ); $Field2 = new Field( '2' ); $A = new A( '3' ); DataCollector::setData('4'); dataHandler::setData('5'); dataHandler::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.0120.00318.47
8.3.50.0100.00622.12
8.3.40.0040.01118.79
8.3.30.0070.01019.04
8.3.20.0050.00220.39
8.3.10.0040.00422.01
8.3.00.0080.00022.46
8.2.180.0090.00616.63
8.2.170.0080.00822.96
8.2.160.0070.00720.94
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0000.00826.16
8.2.120.0080.00019.51
8.2.110.0080.00419.30
8.2.100.0110.00017.84
8.2.90.0040.00417.63
8.2.80.0080.00017.97
8.2.70.0060.00318.05
8.2.60.0040.00418.05
8.2.50.0080.00018.10
8.2.40.0060.00320.59
8.2.30.0040.00418.07
8.2.20.0040.00417.90
8.2.10.0080.00019.65
8.2.00.0040.00417.79
8.1.280.0070.01125.92
8.1.270.0040.00423.86
8.1.260.0030.00626.35
8.1.250.0030.00628.09
8.1.240.0060.00322.55
8.1.230.0000.01122.75
8.1.220.0090.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0050.00517.25
8.1.180.0080.00418.10
8.1.170.0000.00818.65
8.1.160.0070.00321.91
8.1.150.0030.00518.52
8.1.140.0040.00417.54
8.1.130.0000.00717.76
8.1.120.0040.00417.50
8.1.110.0040.00417.50
8.1.100.0070.00017.53
8.1.90.0000.00717.47
8.1.80.0040.00417.41
8.1.70.0030.00317.33
8.1.60.0040.00417.50
8.1.50.0080.00017.45
8.1.40.0060.00317.51
8.1.30.0080.00017.70
8.1.20.0050.00317.58
8.1.10.0030.00617.61
8.1.00.0040.00417.55
8.0.300.0070.00020.07
8.0.290.0050.00316.75
8.0.280.0030.00318.48
8.0.270.0000.00717.21
8.0.260.0050.00316.84
8.0.250.0000.00617.04
8.0.240.0040.00417.00
8.0.230.0000.00617.03
8.0.220.0070.00016.88
8.0.210.0040.00416.96
8.0.200.0050.00217.05
8.0.190.0000.00716.95
8.0.180.0070.00016.95
8.0.170.0030.00616.91
8.0.160.0060.00316.93
8.0.150.0040.00416.95
8.0.140.0050.00216.97
8.0.130.0050.00313.38
8.0.120.0040.00416.93
8.0.110.0000.00816.89
8.0.100.0000.00816.88
8.0.90.0000.00816.84
8.0.80.0060.01317.01
8.0.70.0070.00016.81
8.0.60.0040.00416.94
8.0.50.0050.00216.87
8.0.30.0100.01117.10
8.0.20.0140.00517.40
8.0.10.0000.00717.10
8.0.00.0090.00916.96
7.4.330.0050.00015.00
7.4.320.0030.00316.59
7.4.300.0030.00316.64
7.4.290.0030.00316.48
7.4.280.0070.00016.57
7.4.270.0070.00016.54
7.4.260.0080.00016.64
7.4.250.0030.00516.58
7.4.240.0030.00616.62
7.4.230.0050.00216.60
7.4.220.0120.00616.56
7.4.210.0070.01016.64
7.4.200.0030.00316.65
7.4.190.0070.00016.43
7.4.160.0100.00616.39
7.4.150.0110.00817.40
7.4.140.0140.00517.86
7.4.130.0100.00816.51
7.4.120.0120.00716.68
7.4.110.0150.00716.59
7.4.100.0130.00816.48
7.4.90.0160.00916.68
7.4.80.0170.00816.61
7.4.70.0090.01216.54
7.4.60.0080.00816.54
7.4.50.0000.00816.42
7.4.40.0090.00622.77
7.4.30.0100.00616.49
7.4.00.0040.01314.95
7.3.330.0000.00613.36
7.3.320.0000.00513.27
7.3.310.0000.00716.30
7.3.300.0030.00316.37
7.3.290.0080.00616.35
7.3.280.0070.01416.43
7.3.270.0110.00817.40
7.3.260.0100.01016.63
7.3.250.0110.00716.51
7.3.240.0040.01516.46
7.3.230.0040.01216.54
7.3.210.0140.00716.55
7.3.200.0080.01619.39
7.3.190.0030.01416.40
7.3.180.0070.01316.69
7.3.170.0060.01216.43
7.3.160.0100.01016.46
7.3.120.0090.00715.00
7.3.110.0050.01015.02
7.3.100.0050.00914.93
7.3.90.0060.00514.83
7.3.80.0060.01215.06
7.3.70.0050.00814.88
7.3.60.0080.00814.76
7.3.50.0070.00614.81
7.3.40.0050.01214.94
7.3.30.0040.00714.93
7.3.20.0020.01116.69
7.3.10.0080.00516.59
7.3.00.0090.00516.64
7.2.330.0070.01016.82
7.2.320.0120.00616.92
7.2.310.0250.00016.69
7.2.300.0030.01716.86
7.2.290.0070.01416.71
7.2.250.0100.00715.11
7.2.240.0050.01115.29
7.2.230.0060.00914.91
7.2.220.0050.01014.86
7.2.210.0070.00815.12
7.2.200.0050.01215.04
7.2.190.0050.01215.06
7.2.180.0050.01215.04
7.2.170.0050.01115.09
7.2.160.0030.01015.26
7.2.150.0030.00617.06
7.2.140.0040.01116.94
7.2.130.0050.00816.92
7.2.120.0080.00817.04
7.2.110.0070.01016.90
7.2.100.0150.00016.92
7.2.90.0060.00917.10
7.2.80.0070.00716.98
7.2.70.0070.01016.93
7.2.60.0070.00716.87
7.2.50.0080.00516.88
7.2.40.0090.00316.93
7.2.30.0080.00317.04
7.2.20.0000.01217.00
7.2.10.0030.00816.98
7.2.00.0060.00616.67
7.1.330.0060.00715.68
7.1.320.0070.00815.81
7.1.310.0060.00715.61
7.1.300.0080.00315.77
7.1.290.0090.00815.86
7.1.280.0050.01015.77
7.1.270.0060.00815.75
7.1.260.0050.00815.76
7.1.250.0110.00415.88
7.1.200.0030.01015.38
7.1.70.0000.00816.80
7.1.60.0090.01619.82
7.1.50.0070.01416.84
7.1.00.0100.07022.40
7.0.200.0030.00516.65
7.0.140.0030.07321.93
7.0.100.0070.08319.92
7.0.90.0100.07719.93
7.0.80.0100.08719.88
7.0.70.0100.03719.99
7.0.60.0070.08019.93
7.0.50.0070.07020.32
7.0.40.0030.05720.05
7.0.30.0130.08320.13
7.0.20.0000.07320.09
7.0.10.0170.07720.13
7.0.00.0000.08720.17
5.6.280.0030.07321.03
5.6.250.0100.07020.70
5.6.240.0070.08020.49
5.6.230.0030.08720.66
5.6.220.0130.07320.60
5.6.210.0130.07720.72
5.6.200.0100.08320.98
5.6.190.0070.08721.13
5.6.180.0130.08321.10
5.6.170.0070.08321.05
5.6.160.0130.06321.07
5.6.150.0030.04720.96
5.6.140.0170.04021.15
5.6.130.0070.09321.09
5.6.120.0030.06021.12
5.6.110.0070.09021.14
5.6.100.0100.06021.17
5.6.90.0030.05721.10
5.6.80.0070.07020.45
5.6.70.0230.05320.30
5.6.60.0070.08320.46
5.6.50.0130.08020.46
5.6.40.0000.07720.45
5.6.30.0070.05020.41
5.6.20.0030.08320.45
5.6.10.0100.07720.31
5.6.00.0070.07720.46
5.5.380.0100.08020.38
5.5.370.0100.07320.36
5.5.360.0070.04320.51
5.5.350.0200.06720.43
5.5.340.0030.05320.88
5.5.330.0170.06720.90
5.5.320.0230.07320.92
5.5.310.0100.07020.81
5.5.300.0030.09020.90
5.5.290.0130.08020.93
5.5.280.0070.08020.91
5.5.270.0000.05720.88
5.5.260.0100.08320.87
5.5.250.0000.09320.59
5.5.240.0100.08020.30
5.5.230.0100.07720.17
5.5.220.0070.05720.22
5.5.210.0030.05020.32
5.5.200.0030.04020.23
5.5.190.0100.07720.20
5.5.180.0130.07320.27
5.5.160.0070.05320.19
5.5.150.0170.06320.00
5.5.140.0070.08020.25
5.5.130.0130.08020.16
5.5.120.0100.07720.28
5.5.110.0100.08020.16
5.5.100.0130.07319.99
5.5.90.0130.07320.05
5.5.80.0070.07720.05
5.5.70.0100.06020.12
5.5.60.0070.08020.17
5.5.50.0030.07720.04
5.5.40.0130.07020.12
5.5.30.0170.06720.12
5.5.20.0170.09020.15
5.5.10.0170.06319.97
5.5.00.0030.07719.96
5.4.450.0070.08719.49
5.4.440.0170.06319.50
5.4.430.0170.07019.35
5.4.420.0130.08019.49
5.4.410.0100.05319.41
5.4.400.0130.07318.96
5.4.390.0130.06719.23
5.4.380.0130.05318.88
5.4.370.0200.06719.10
5.4.360.0100.07319.09
5.4.350.0130.07319.13
5.4.340.0100.08018.90
5.4.320.0100.07018.84
5.4.310.0100.07019.25
5.4.300.0000.08719.21
5.4.290.0030.07019.23
5.4.280.0100.06719.12
5.4.270.0130.07319.21
5.4.260.0070.08019.12
5.4.250.0070.07319.02
5.4.240.0130.07019.12
5.4.230.0100.06719.04
5.4.220.0070.07719.20
5.4.210.0130.07318.94
5.4.200.0070.08019.20
5.4.190.0030.08319.08
5.4.180.0030.04719.02
5.4.170.0030.04719.15
5.4.160.0170.05319.10
5.4.150.0100.07719.14
5.4.140.0070.08016.47
5.4.130.0100.07016.37
5.4.120.0070.07316.30
5.4.110.0030.07716.55
5.4.100.0070.07016.36
5.4.90.0070.07016.56
5.4.80.0130.06016.37
5.4.70.0070.07016.31
5.4.60.0100.06316.49
5.4.50.0100.06716.30
5.4.40.0030.08016.46
5.4.30.0030.05316.36
5.4.20.0000.06716.30
5.4.10.0030.05016.25
5.4.00.0030.07715.73
5.3.290.0030.07714.66
5.3.280.0070.07714.55
5.3.270.0070.07314.60
5.3.260.0030.08014.52
5.3.250.0100.06714.46
5.3.240.0070.07714.57
5.3.230.0070.04314.58
5.3.220.0100.07714.48
5.3.210.0070.07714.52
5.3.200.0170.06314.58
5.3.190.0100.07314.51
5.3.180.0170.06314.57
5.3.170.0130.07714.52
5.3.160.0070.07714.39
5.3.150.0200.05014.53
5.3.140.0100.06714.54
5.3.130.0070.07714.54
5.3.120.0070.08014.38
5.3.110.0000.08314.49
5.3.100.0200.06314.04
5.3.90.0070.07713.93
5.3.80.0130.07013.80
5.3.70.0070.07313.88
5.3.60.0130.06313.78
5.3.50.0030.05013.94
5.3.40.0130.06713.94
5.3.30.0100.06313.79
5.3.20.0100.07013.47
5.3.10.0030.05013.41
5.3.00.0070.07013.63
5.2.170.0070.06011.17
5.2.160.0030.06310.96
5.2.150.0100.06311.19
5.2.140.0070.06711.09
5.2.130.0130.05711.12
5.2.120.0070.03010.91
5.2.110.0030.06711.12
5.2.100.0100.05010.95
5.2.90.0070.06011.05
5.2.80.0030.04710.96
5.2.70.0070.06711.02
5.2.60.0070.03710.91
5.2.50.0030.06310.80
5.2.40.0030.06310.99
5.2.30.0130.05011.04
5.2.20.0030.05711.03
5.2.10.0030.06010.81
5.2.00.0070.06010.78
5.1.60.0030.05310.36
5.1.50.0030.05710.36
5.1.40.0070.05010.36
5.1.30.0070.05710.36
5.1.20.0030.05310.36
5.1.10.0030.05710.36
5.1.00.0070.04010.36
5.0.50.0000.05010.36
5.0.40.0000.04010.36
5.0.30.0000.06710.36
5.0.20.0030.04310.36
5.0.10.0000.04710.36
5.0.00.0070.05010.36
4.4.90.0000.03010.36
4.4.80.0030.03710.36
4.4.70.0000.03710.36
4.4.60.0100.03010.36
4.4.50.0100.03010.36
4.4.40.0030.05310.36
4.4.30.0000.02710.36
4.4.20.0070.03310.36
4.4.10.0000.03310.36
4.4.00.0030.05310.36
4.3.110.0030.03310.36
4.3.100.0000.03710.36
4.3.90.0070.02310.36
4.3.80.0030.05310.36
4.3.70.0030.03310.36
4.3.60.0070.02310.36
4.3.50.0030.01710.36
4.3.40.0000.05310.36
4.3.30.0000.04010.36
4.3.20.0000.03310.36
4.3.10.0000.03710.36
4.3.00.0030.03010.36

preferences:
40.23 ms | 401 KiB | 5 Q