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 { } } 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.0070.01116.74
8.3.50.0120.00922.00
8.3.40.0080.00818.59
8.3.30.0070.00719.04
8.3.20.0040.00420.35
8.3.10.0120.00323.65
8.3.00.0120.00919.38
8.2.180.0070.01418.29
8.2.170.0190.00022.96
8.2.160.0100.01020.32
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0090.00926.16
8.2.120.0080.00022.12
8.2.110.0060.00322.09
8.2.100.0040.00818.03
8.2.90.0060.00319.34
8.2.80.0000.00918.05
8.2.70.0040.00417.63
8.2.60.0060.00318.05
8.2.50.0060.00318.07
8.2.40.0000.00818.17
8.2.30.0030.00618.13
8.2.20.0070.00417.84
8.2.10.0080.00018.17
8.2.00.0000.00817.77
8.1.280.0210.00025.92
8.1.270.0080.00023.70
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01023.67
8.1.230.0000.01119.05
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0100.00017.25
8.1.190.0030.00517.41
8.1.180.0000.00818.10
8.1.170.0000.00818.72
8.1.160.0050.00222.11
8.1.150.0000.00718.63
8.1.140.0040.00417.42
8.1.130.0030.00317.85
8.1.120.0000.00717.50
8.1.110.0040.00417.48
8.1.100.0050.00217.37
8.1.90.0040.00317.50
8.1.80.0030.00317.39
8.1.70.0070.00017.33
8.1.60.0040.00417.67
8.1.50.0000.00817.46
8.1.40.0060.00317.57
8.1.30.0060.00317.60
8.1.20.0040.00417.66
8.1.10.0000.00717.63
8.1.00.0000.00817.46
8.0.300.0070.00018.77
8.0.290.0040.00417.05
8.0.280.0040.00418.34
8.0.270.0000.00717.28
8.0.260.0030.00316.96
8.0.250.0000.00717.02
8.0.240.0000.00716.99
8.0.230.0070.00016.99
8.0.220.0000.00716.94
8.0.210.0070.00016.88
8.0.200.0000.00617.00
8.0.190.0040.00417.05
8.0.180.0000.00717.06
8.0.170.0000.00817.01
8.0.160.0030.00516.98
8.0.150.0090.00016.95
8.0.140.0040.00416.84
8.0.130.0000.00613.41
8.0.120.0040.00416.97
8.0.110.0040.00416.96
8.0.100.0030.00516.78
8.0.90.0020.00517.02
8.0.80.0100.01016.91
8.0.70.0040.00416.84
8.0.60.0040.00416.88
8.0.50.0030.00516.89
8.0.30.0100.00917.21
8.0.20.0140.00917.40
8.0.10.0050.00217.04
8.0.00.0110.00816.94
7.4.330.0030.00315.00
7.4.320.0060.00016.54
7.4.300.0030.00316.54
7.4.290.0000.00716.42
7.4.280.0030.00316.61
7.4.270.0000.00716.51
7.4.260.0030.00516.50
7.4.250.0070.00016.59
7.4.240.0020.00616.63
7.4.230.0080.00016.63
7.4.220.0030.01216.60
7.4.210.0050.01116.64
7.4.200.0000.00716.64
7.4.190.0000.00716.48
7.4.160.0100.00716.48
7.4.150.0170.01017.40
7.4.140.0150.00817.86
7.4.130.0090.00816.46
7.4.120.0090.01116.72
7.4.110.0120.00916.58
7.4.100.0090.00916.64
7.4.90.0120.01216.50
7.4.80.0110.01119.39
7.4.70.0060.01216.54
7.4.60.0070.01016.60
7.4.50.0000.00816.55
7.4.40.0150.00322.77
7.4.30.0020.01316.60
7.4.00.0120.00314.82
7.3.330.0060.00013.23
7.3.320.0000.00613.26
7.3.310.0030.00316.31
7.3.300.0070.00016.28
7.3.290.0110.00716.34
7.3.280.0120.00416.44
7.3.270.0110.00817.40
7.3.260.0120.00616.63
7.3.250.0130.00916.62
7.3.240.0110.00716.64
7.3.230.0110.00816.54
7.3.210.0130.00616.65
7.3.200.0070.01019.39
7.3.190.0120.00616.56
7.3.180.0100.00616.50
7.3.170.0120.00916.46
7.3.160.0150.00616.57
7.3.120.0090.00614.88
7.3.10.0070.01615.96
7.3.00.0180.00016.34
7.2.330.0070.01416.76
7.2.320.0000.01716.64
7.2.310.0080.00816.78
7.2.300.0070.01116.70
7.2.290.0110.01116.70
7.2.130.0270.00316.45
7.2.120.0120.01616.80
7.2.110.0300.01016.40
7.2.100.0200.00716.60
7.2.90.0080.01316.14
7.2.80.0110.00816.59
7.2.70.0160.00516.16
7.2.60.0130.00616.73
7.2.50.0120.01316.56
7.2.40.0120.01016.29
7.2.30.0140.01116.04
7.2.20.0230.00616.78
7.2.10.0170.01016.05
7.2.00.0070.00917.88
7.1.250.0130.00715.51
7.1.200.0030.01015.68
7.1.70.0080.00817.12
7.1.60.0070.00716.98
7.1.50.0120.00316.96
7.1.00.0070.07322.44
7.0.200.0030.01316.78
7.0.140.0030.07021.93
7.0.60.0200.06720.09
7.0.50.0100.05017.88
7.0.40.0130.08020.30
7.0.30.0200.04320.23
7.0.20.0430.07020.19
7.0.10.0070.08720.16
7.0.00.0070.08320.10
5.6.280.0030.07320.88
5.6.210.0030.05320.56
5.6.200.0000.05318.29
5.6.190.0030.04320.35
5.6.180.0270.08020.46
5.6.170.0230.06020.55
5.6.160.0100.08020.52
5.6.150.0100.03318.23
5.6.140.0030.06718.17
5.6.130.0070.03718.29
5.6.120.0100.07321.03
5.6.110.0070.04721.12
5.6.100.0170.07320.96
5.6.90.0070.09020.89
5.6.80.0070.08020.49
5.5.350.4000.04720.38
5.5.340.0100.06717.95
5.5.330.0070.06020.43
5.5.320.0030.08320.29
5.5.310.0270.07720.32
5.5.300.0000.06018.08
5.5.290.0030.08717.94
5.5.280.0100.05020.78
5.5.270.0070.07020.66
5.5.260.0070.06020.98
5.5.250.0070.03720.59
5.5.240.0300.07720.38
5.4.450.0070.03719.17
5.4.440.0030.04319.49
5.4.430.0130.03019.63
5.4.420.0070.04319.30
5.4.410.0100.03319.07
5.4.400.0030.07719.16
5.4.390.0000.05719.19
5.4.380.0030.05719.14
5.4.370.0070.07719.05
5.4.360.0070.07318.87
5.4.350.0100.06019.17
5.4.340.0070.06319.22
5.4.320.0070.05318.95
5.4.310.0000.07019.22
5.4.300.0100.05719.30
5.4.290.0070.07319.12
5.4.280.0100.07018.84
5.4.270.0070.04719.08
5.4.260.0070.07719.09
5.4.250.0100.04719.19
5.4.240.0100.07318.95
5.4.230.0070.03719.21
5.4.220.0130.08719.21
5.4.210.0070.07319.18
5.4.200.0100.03719.12
5.4.190.0070.07019.11
5.4.180.0070.07319.08
5.4.170.0030.04019.11
5.4.160.0000.06019.20
5.4.150.0100.03319.12
5.4.140.0000.06316.49
5.4.130.0070.04016.40
5.4.120.0030.05316.56
5.4.110.0070.03316.63
5.4.100.0030.07716.45
5.4.90.0030.04716.51
5.4.80.0030.07016.59
5.4.70.0070.06716.41
5.4.60.0030.07316.49
5.4.50.0130.05716.17
5.4.40.0130.06316.33
5.4.30.0030.07016.32
5.4.20.0030.04016.42
5.4.10.0030.05316.26
5.4.00.0100.07715.94
5.3.290.0070.07014.54
5.3.280.0030.03714.55
5.3.270.0030.03714.47
5.3.260.0030.04014.45
5.3.250.0070.04314.55
5.3.240.0030.07014.46
5.3.230.0100.06014.54
5.3.220.0000.04014.40
5.3.210.0030.06314.43
5.3.200.0070.03714.55
5.3.190.0030.04314.53
5.3.180.0030.05314.50
5.3.170.0030.07314.40
5.3.160.0030.06014.51
5.3.150.0070.04014.52
5.3.140.0030.04714.44
5.3.130.0070.06314.38
5.3.120.0070.04314.39
5.3.110.0030.07714.49
5.3.100.0170.03313.92
5.3.90.0030.07714.04
5.3.80.0030.05014.03
5.3.70.0070.06714.11
5.3.60.0070.07313.86
5.3.50.0100.06713.86
5.3.40.0070.05713.86
5.3.30.0070.06313.86
5.3.20.0030.04713.86
5.3.10.0070.03313.86
5.3.00.0030.05713.86
5.2.170.0130.02713.86
5.2.160.0000.04013.86
5.2.150.0000.04313.86
5.2.140.0030.04313.86
5.2.130.0000.03313.86
5.2.120.0070.06013.86
5.2.110.0030.06013.86
5.2.100.0000.05313.86
5.2.90.0000.05313.86
5.2.80.0070.03313.86
5.2.70.0000.05313.86
5.2.60.0000.04013.86
5.2.50.0000.06313.86
5.2.40.0030.02713.86
5.2.30.0030.02713.86
5.2.20.0000.06313.86
5.2.10.0130.05013.86
5.2.00.0070.03313.86
5.1.60.0030.03713.86
5.1.50.0070.01713.86
5.1.40.0000.03013.86
5.1.30.0000.03013.86
5.1.20.0070.02013.86
5.1.10.0000.02313.86
5.1.00.0000.02713.86
5.0.50.0030.01713.86
5.0.40.0030.01713.86
5.0.30.0000.03013.86
5.0.20.0000.02013.86
5.0.10.0000.02013.86
5.0.00.0000.03313.86
4.4.90.0000.01713.86
4.4.80.0000.02013.86
4.4.70.0030.01313.86
4.4.60.0000.01313.86
4.4.50.0000.01313.86
4.4.40.0030.02313.86
4.4.30.0000.01313.86
4.4.20.0000.01313.86
4.4.10.0000.01313.86
4.4.00.0000.02313.86
4.3.110.0000.01713.86
4.3.100.0000.01313.86
4.3.90.0000.01313.86
4.3.80.0030.02013.86
4.3.70.0000.01313.86
4.3.60.0030.01013.86
4.3.50.0000.01313.86
4.3.40.0000.02713.86
4.3.30.0000.01313.86
4.3.20.0000.01713.86
4.3.10.0000.01713.86
4.3.00.0000.01313.86

preferences:
53.39 ms | 400 KiB | 5 Q