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::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.40.0110.00718.83
8.3.30.0170.00319.05
8.3.20.0040.00420.22
8.3.10.0040.00423.45
8.3.00.0040.00420.58
8.2.170.0150.00322.96
8.2.160.0030.01022.12
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00420.92
8.2.110.0060.00320.35
8.2.100.0100.00017.84
8.2.90.0090.00019.39
8.2.80.0040.00418.05
8.2.70.0060.00317.63
8.2.60.0030.00518.16
8.2.50.0120.00018.07
8.2.40.0080.00018.22
8.2.30.0000.00718.17
8.2.20.0040.00417.79
8.2.10.0000.00817.79
8.2.00.0000.00817.82
8.1.270.0040.00423.92
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00423.73
8.1.230.0080.00422.59
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0040.00417.36
8.1.190.0000.00817.52
8.1.180.0040.00418.10
8.1.170.0060.00318.65
8.1.160.0000.00722.13
8.1.150.0070.00018.55
8.1.140.0070.00017.46
8.1.130.0000.00717.71
8.1.120.0080.00017.47
8.1.110.0040.00417.34
8.1.100.0000.00717.48
8.1.90.0000.00817.51
8.1.80.0040.00417.35
8.1.70.0030.00317.43
8.1.60.0030.00517.54
8.1.50.0030.00617.57
8.1.40.0000.00917.51
8.1.30.0040.00417.60
8.1.20.0040.00417.72
8.1.10.0090.00017.48
8.1.00.0030.00517.53
8.0.300.0050.00218.77
8.0.290.0000.00717.05
8.0.280.0050.00318.49
8.0.270.0000.00717.13
8.0.260.0050.00316.88
8.0.250.0030.00316.91
8.0.240.0040.00417.01
8.0.230.0030.00317.05
8.0.220.0000.00816.98
8.0.210.0070.00016.96
8.0.200.0000.00616.90
8.0.190.0000.00817.04
8.0.180.0000.00716.91
8.0.170.0080.00016.99
8.0.160.0020.00516.84
8.0.150.0000.00716.88
8.0.140.0000.00716.87
8.0.130.0000.00613.38
8.0.120.0040.00416.93
8.0.110.0000.00716.86
8.0.100.0000.00716.75
8.0.90.0040.00416.93
8.0.80.0130.00316.96
8.0.70.0050.00316.82
8.0.60.0040.00416.87
8.0.50.0070.00016.91
8.0.30.0190.00216.99
8.0.20.0100.01017.40
8.0.10.0000.00716.96
8.0.00.0140.00416.72
7.4.330.0050.00015.15
7.4.320.0000.00716.53
7.4.300.0070.00016.59
7.4.290.0050.00316.48
7.4.280.0070.00016.49
7.4.270.0040.00416.61
7.4.260.0030.00316.39
7.4.250.0050.00316.47
7.4.240.0030.00516.50
7.4.230.0030.00316.58
7.4.220.0160.00316.37
7.4.210.0090.00816.61
7.4.200.0000.00716.67
7.4.190.0030.00316.41
7.4.160.0090.00916.39
7.4.150.0130.01317.40
7.4.140.0080.01017.86
7.4.130.0000.01916.43
7.4.120.0140.00316.53
7.4.110.0130.00616.38
7.4.100.0130.00516.45
7.4.90.0100.00816.57
7.4.80.0040.01216.59
7.4.70.0100.01016.55
7.4.60.0030.01216.53
7.4.50.0060.00316.33
7.4.40.0030.01222.77
7.4.30.0090.00616.58
7.4.00.0040.01315.04
7.3.330.0000.00613.26
7.3.320.0050.00013.26
7.3.310.0030.00316.43
7.3.300.0030.00316.28
7.3.290.0090.01216.34
7.3.280.0080.01216.36
7.3.270.0110.01417.40
7.3.260.0140.01316.43
7.3.250.0090.01016.45
7.3.240.0100.00716.35
7.3.230.0140.00416.39
7.3.210.0110.00616.56
7.3.200.0060.01219.39
7.3.190.0070.01116.47
7.3.180.0090.00816.42
7.3.170.0090.01116.53
7.3.160.0060.01816.43
7.3.120.0040.01114.88
7.2.330.0050.01716.77
7.2.320.0090.00916.52
7.2.310.0060.01216.77
7.2.300.0060.01016.76
7.2.290.0060.01516.54
7.2.60.0130.00016.73
7.2.00.0110.00019.36
7.1.200.0000.01315.66
7.1.100.0040.01218.11
7.1.70.0050.00217.07
7.1.60.0140.01019.32
7.1.50.0090.01316.73
7.1.00.0070.07322.29
7.0.200.0080.00416.52
7.0.140.0100.06722.04
7.0.100.0000.06719.87
7.0.90.0130.08719.89
7.0.80.0300.04319.93
7.0.70.0070.08019.93
7.0.60.0070.09019.90
7.0.50.0100.07320.23
7.0.40.0070.08320.05
7.0.30.0000.05720.09
7.0.20.0170.05019.90
7.0.10.0070.04020.08
7.0.00.0200.07020.07
5.6.280.0030.07020.91
5.6.250.0130.08020.63
5.6.240.0030.09020.60
5.6.230.0170.07320.55
5.6.220.0070.07320.51
5.6.210.0030.08720.54
5.6.200.0130.07721.00
5.6.190.0130.09021.00
5.6.180.0030.09020.97
5.6.170.0070.04720.92
5.6.160.0070.08320.91
5.6.150.0030.07320.91
5.6.140.0100.06320.89
5.6.130.0100.04721.09
5.6.120.0030.07020.99
5.6.110.0130.07720.91
5.6.100.0100.04721.00
5.6.90.0030.08721.07
5.6.80.0100.05020.36
5.6.70.0070.05020.39
5.6.60.0070.07320.50
5.6.50.0100.07720.46
5.6.40.0100.07320.27
5.6.30.0000.07320.27
5.6.20.0130.05320.30
5.6.10.0100.08020.25
5.6.00.0130.06720.25
5.5.380.0100.07020.39
5.5.370.0070.06020.51
5.5.360.0070.08320.46
5.5.350.0030.08320.40
5.5.340.0100.07320.77
5.5.330.0030.05020.69
5.5.320.0070.04720.73
5.5.310.0000.04720.84
5.5.300.0070.07020.79
5.5.290.0130.06320.69
5.5.280.0030.09320.75
5.5.270.0100.04320.81
5.5.260.0230.06720.78
5.5.250.0070.09320.53
5.5.240.0100.07020.10
5.5.230.0200.06020.22
5.5.220.0070.07320.24
5.5.210.0000.05020.27
5.5.200.0030.06720.08
5.5.190.0130.07020.09
5.5.180.0070.07320.14
5.5.160.0070.06020.19
5.5.150.0070.04320.18
5.5.140.0070.08020.23
5.5.130.0030.06020.19
5.5.120.0070.07720.05
5.5.110.0070.05020.17
5.5.100.0130.06020.07
5.5.90.0100.03320.07
5.5.80.0030.07020.09
5.5.70.0100.03319.96
5.5.60.0070.04720.06
5.5.50.0130.07020.02
5.5.40.0100.05720.02
5.5.30.0070.07320.09
5.5.20.0070.04320.09
5.5.10.0000.08320.02
5.5.00.0070.08320.08
5.4.450.0130.07019.49
5.4.440.0170.04319.17
5.4.430.0130.08019.47
5.4.420.0030.08319.35
5.4.410.0100.07719.10
5.4.400.0030.04319.09
5.4.390.0100.07319.21
5.4.380.0100.07019.03
5.4.370.0000.05019.18
5.4.360.0000.08019.14
5.4.350.0030.07319.12
5.4.340.0000.07018.90
5.4.320.0130.06319.05
5.4.310.0030.04319.03
5.4.300.0170.05019.04
5.4.290.0130.07319.13
5.4.280.0130.05719.02
5.4.270.0100.07019.13
5.4.260.0000.05018.87
5.4.250.0030.06018.87
5.4.240.0070.03719.22
5.4.230.0030.04719.13
5.4.220.0100.07319.12
5.4.210.0030.04319.13
5.4.200.0030.08318.87
5.4.190.0070.06319.20
5.4.180.0030.05719.02
5.4.170.0130.08019.12
5.4.160.0070.04719.15
5.4.150.0070.06319.20
5.4.140.0070.06716.50
5.4.130.0070.06016.39
5.4.120.0030.04316.48
5.4.110.0030.07716.35
5.4.100.0030.06016.52
5.4.90.0100.06316.46
5.4.80.0070.06316.40
5.4.70.0030.08016.38
5.4.60.0100.04016.42
5.4.50.0070.06716.34
5.4.40.0130.06716.35
5.4.30.0100.07016.42
5.4.20.0000.07316.53
5.4.10.0000.04716.47
5.4.00.0100.06315.71
5.3.290.0070.05014.52
5.3.280.0030.08014.45
5.3.270.0130.07014.47
5.3.260.0000.05014.46
5.3.250.0030.04314.46
5.3.240.0030.07714.60
5.3.230.0030.07314.46
5.3.220.0070.06714.55
5.3.210.0100.07314.43
5.3.200.0030.04014.43
5.3.190.0100.07314.55
5.3.180.0130.07014.52
5.3.170.0030.07714.50
5.3.160.0070.05714.52
5.3.150.0070.04314.43
5.3.140.0030.08314.56
5.3.130.0070.06314.53
5.3.120.0170.06014.39
5.3.110.0070.07014.56
5.3.100.0170.06013.90
5.3.90.0130.07013.97
5.3.80.0070.03313.79
5.3.70.0070.03314.01
5.3.60.0070.06013.94
5.3.50.0130.06313.71
5.3.40.0030.06013.92
5.3.30.0130.06313.86
5.3.20.0070.08013.62
5.3.10.0030.06313.60
5.3.00.0070.06313.39
5.2.170.0030.06310.96
5.2.160.0030.03310.98
5.2.150.0100.05711.15
5.2.140.0000.03711.13
5.2.130.0070.06011.02
5.2.120.0070.05310.96
5.2.110.0000.06311.05
5.2.100.0070.05711.09
5.2.90.0070.05711.15
5.2.80.0100.05311.08
5.2.70.0030.05710.94
5.2.60.0100.05711.07
5.2.50.0070.06710.86
5.2.40.0100.05710.99
5.2.30.0030.06011.01
5.2.20.0070.05711.03
5.2.10.0100.04310.79
5.2.00.0030.03310.79
5.1.60.0000.0409.83
5.1.50.0030.04010.01
5.1.40.0030.03710.00
5.1.30.0030.05310.35
5.1.20.0100.05010.27
5.1.10.0030.04010.09
5.1.00.0030.05310.11
5.0.50.0000.0378.43
5.0.40.0030.0378.43
5.0.30.0070.0638.27
5.0.20.0000.0438.29
5.0.10.0070.0408.05
5.0.00.0070.0438.24
4.4.90.0030.0337.62
4.4.80.0030.0337.62
4.4.70.0070.0277.62
4.4.60.0000.0307.62
4.4.50.0030.0437.62
4.4.40.0030.0507.62
4.4.30.0070.0307.62
4.4.20.0000.0337.62
4.4.10.0030.0207.62
4.4.00.0070.0437.62
4.3.110.0000.0407.62
4.3.100.0000.0377.62
4.3.90.0000.0177.62
4.3.80.0000.0437.62
4.3.70.0030.0177.62
4.3.60.0000.0377.62
4.3.50.0000.0237.62
4.3.40.0030.0507.62
4.3.30.0000.0337.62
4.3.20.0030.0177.62
4.3.10.0030.0207.62
4.3.00.0000.0277.62

preferences:
43.59 ms | 400 KiB | 5 Q