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( 'text' ); $Field2 = new Field( 'html' ); $A = new A( '3' ); Form::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.00618.68
8.3.50.0090.01022.05
8.3.40.0100.01018.90
8.3.30.0100.01018.84
8.3.20.0110.00418.81
8.3.10.0050.00521.22
8.3.00.0070.00721.90
8.2.180.0110.00816.63
8.2.170.0100.00322.96
8.2.160.0120.00320.57
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0070.00021.04
8.2.110.0030.00720.87
8.2.100.0080.00417.84
8.2.90.0050.00319.17
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0090.00017.93
8.2.50.0030.00718.07
8.2.40.0060.00318.34
8.2.30.0000.00821.25
8.2.20.0070.00017.84
8.2.10.0000.00817.68
8.2.00.0040.00417.70
8.1.280.0070.01125.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00423.91
8.1.230.0080.00420.90
8.1.220.0090.00018.77
8.1.210.0000.00818.90
8.1.200.0030.00617.34
8.1.190.0040.00417.53
8.1.180.0030.00518.10
8.1.170.0000.00818.49
8.1.160.0040.00418.90
8.1.150.0070.00018.60
8.1.140.0000.00717.45
8.1.130.0000.00717.84
8.1.120.0050.00217.48
8.1.110.0040.00417.48
8.1.100.0040.00417.36
8.1.90.0040.00317.38
8.1.80.0050.00217.39
8.1.70.0040.00417.35
8.1.60.0000.00917.58
8.1.50.0000.00817.48
8.1.40.0060.00317.48
8.1.30.0000.00817.62
8.1.20.0030.00517.61
8.1.10.0040.00417.59
8.1.00.0060.00617.43
8.0.300.0080.00319.88
8.0.290.0000.00817.28
8.0.280.0050.00218.49
8.0.270.0070.00017.26
8.0.260.0030.00316.94
8.0.250.0000.00816.92
8.0.240.0000.00817.05
8.0.230.0030.00316.95
8.0.220.0070.00016.96
8.0.210.0030.00516.90
8.0.200.0070.00017.04
8.0.190.0050.00317.01
8.0.180.0040.00416.82
8.0.170.0040.00416.88
8.0.160.0040.00416.96
8.0.150.0030.00516.93
8.0.140.0000.00816.82
8.0.130.0000.00613.40
8.0.120.0080.00016.77
8.0.110.0070.00017.06
8.0.100.0000.00716.91
8.0.90.0040.00416.84
8.0.80.0160.00716.92
8.0.70.0070.00016.82
8.0.60.0000.00817.00
8.0.50.0000.00816.99
8.0.30.0170.00316.98
8.0.20.0120.00817.40
8.0.10.0040.00416.95
8.0.00.0090.00916.70
7.4.330.0030.00314.66
7.4.320.0040.00416.51
7.4.300.0000.00616.49
7.4.290.0030.00316.67
7.4.280.0040.00416.44
7.4.270.0070.00016.51
7.4.260.0000.00713.34
7.4.250.0070.00016.47
7.4.240.0050.00216.53
7.4.230.0060.00316.59
7.4.220.0090.00916.50
7.4.210.0130.00316.60
7.4.200.0000.00716.64
7.4.190.0030.00516.68
7.4.160.0140.01016.60
7.4.150.0060.01217.40
7.4.140.0080.01017.86
7.4.130.0160.00716.59
7.4.120.0040.01316.64
7.4.110.0060.01216.49
7.4.100.0130.01016.50
7.4.90.0030.02016.43
7.4.80.0120.00919.39
7.4.70.0090.00916.45
7.4.60.0070.01016.54
7.4.50.0030.00616.70
7.4.40.0100.00722.77
7.4.30.0150.00316.33
7.4.00.0030.01014.71
7.3.330.0000.00513.32
7.3.320.0060.00013.39
7.3.310.0070.00016.43
7.3.300.0030.00316.25
7.3.290.0100.01016.38
7.3.280.0100.00716.37
7.3.270.0060.01217.40
7.3.260.0120.00918.24
7.3.250.0110.00816.51
7.3.240.0120.00616.55
7.3.230.0090.00916.59
7.3.210.0140.00316.46
7.3.200.0090.01319.39
7.3.190.0090.00916.38
7.3.180.0100.01016.48
7.3.170.0050.01116.43
7.3.160.0100.00716.52
7.3.120.0060.00914.54
7.3.00.0270.00515.62
7.2.330.0120.00616.75
7.2.320.0100.00716.87
7.2.310.0100.01416.58
7.2.300.0120.00616.54
7.2.290.0110.00616.53
7.2.130.0200.00716.01
7.2.120.0210.01015.98
7.2.110.0250.01015.89
7.2.100.0240.00716.09
7.2.90.0220.00316.04
7.2.80.0320.00416.03
7.2.70.0160.01215.81
7.2.60.0220.00716.10
7.2.50.0260.00716.17
7.2.40.0240.00715.88
7.2.30.0200.01215.90
7.2.20.0260.01115.89
7.2.10.0270.00615.79
7.2.00.0240.00617.11
7.1.250.0210.00814.83
7.1.240.0170.01114.58
7.1.230.0230.00914.72
7.1.220.0260.00914.73
7.1.210.0210.00914.79
7.1.200.0310.00615.01
7.1.190.0340.00614.79
7.1.180.0310.00714.54
7.1.170.0260.00814.75
7.1.160.0220.00614.72
7.1.150.0260.00314.81
7.1.140.0220.01014.47
7.1.130.0360.00414.79
7.1.120.0350.00514.61
7.1.110.0260.00614.79
7.1.100.0220.00915.86
7.1.90.0330.00714.77
7.1.80.0290.00614.91
7.1.70.0180.00715.68
7.1.60.0230.01216.34
7.1.50.0210.00515.54
7.1.40.0210.00614.88
7.1.30.0430.00514.64
7.1.20.0260.00714.88
7.1.10.0250.00514.72
7.1.00.0140.01617.18
7.0.330.0350.00414.51
7.0.320.0730.00814.36
7.0.310.0190.01014.39
7.0.300.0250.01014.47
7.0.290.0300.01214.20
7.0.280.0370.00614.23
7.0.270.0270.00814.44
7.0.260.0310.00714.33
7.0.250.0310.01014.34
7.0.240.0590.00714.52
7.0.230.0300.00514.42
7.0.220.0270.00814.55
7.0.210.0250.00614.43
7.0.200.0190.00815.19
7.0.190.0360.00514.58
7.0.180.0200.00814.46
7.0.170.0280.00514.54
7.0.160.0240.00814.33
7.0.150.0230.00914.41
7.0.140.0200.02516.96
7.0.130.0220.00614.53
7.0.120.0220.00214.42
7.0.110.0260.00514.38
7.0.100.0290.00614.31
7.0.90.0280.00714.66
7.0.80.0190.00814.30
7.0.70.0120.01314.29
7.0.60.0150.02816.85
7.0.50.0160.03717.04
7.0.40.0190.03115.63
7.0.30.0210.03115.61
7.0.20.0170.03215.70
7.0.10.0150.03215.70
7.0.00.0120.03515.71
5.6.380.0120.00514.47
5.6.370.0040.01113.90
5.6.360.0090.00914.13
5.6.350.0080.00814.34
5.6.340.0050.01214.14
5.6.330.0120.00714.61
5.6.320.0110.00714.50
5.6.310.0090.01314.38
5.6.300.0090.00814.39
5.6.290.0080.01114.57
5.6.280.0060.03116.61
5.6.270.0150.00614.32
5.6.260.0150.00114.49
5.6.250.0120.00714.50
5.6.240.0070.01014.45
5.6.230.0120.00514.29
5.6.220.0110.00814.40
5.6.210.0140.01416.40
5.6.200.0110.03116.69
5.6.190.0050.03616.49
5.6.180.0120.03316.45
5.6.170.0090.03216.53
5.6.160.0100.03016.58
5.6.150.0040.03516.68
5.6.140.0080.03416.58
5.6.130.0050.02916.61
5.6.120.0070.03616.52
5.6.110.0090.03316.55
5.6.100.0110.03316.59
5.6.90.0060.03616.46
5.6.80.0030.03516.18
5.6.70.0120.02816.15
5.6.60.0090.03116.09
5.6.50.0050.03316.21
5.6.40.0150.02716.25
5.6.30.0050.03516.16
5.6.20.0040.03616.31
5.6.10.0060.03316.18
5.6.00.0080.03216.23
5.5.380.0080.00611.27
5.5.370.0040.00811.21
5.5.360.0080.00511.13
5.5.350.0090.02214.20
5.5.340.0080.03014.39
5.5.330.0070.02514.49
5.5.320.0060.03014.25
5.5.310.0080.02914.31
5.5.300.0060.03114.43
5.5.290.0040.03514.42
5.5.280.0070.03114.56
5.5.270.0090.02414.30
5.5.260.0060.02014.42
5.5.250.0040.03214.29
5.5.240.0030.03514.08
5.5.230.0050.03213.96
5.5.220.0030.02714.13
5.5.210.0090.02614.05
5.5.200.0030.03114.00
5.5.190.0060.02914.00
5.5.180.0060.03013.99
5.5.170.0010.01111.11
5.5.160.0050.03014.14
5.5.150.0070.02914.13
5.5.140.0070.02713.97
5.5.130.0030.03514.08
5.5.120.0070.02214.04
5.5.110.0070.02513.86
5.5.100.0050.02314.19
5.5.90.0040.02614.10
5.5.80.0070.02613.97
5.5.70.0070.02813.90
5.5.60.0030.03113.97
5.5.50.0090.02513.90
5.5.40.0070.02814.08
5.5.30.0100.02913.91
5.5.20.0040.03013.94
5.5.10.0100.02213.88
5.5.00.0060.02914.04
5.4.450.0100.02713.89
5.4.440.0090.02814.01
5.4.430.0070.03113.91
5.4.420.0070.03113.80
5.4.410.0100.02813.66
5.4.400.0040.03013.80
5.4.390.0080.02913.84
5.4.380.0100.02413.62
5.4.370.0070.02713.51
5.4.360.0080.02613.79
5.4.350.0100.02713.59
5.4.340.0060.03013.86
5.4.330.0110.00511.20
5.4.320.0120.02513.65
5.4.310.0100.02113.79
5.4.300.0050.02913.69
5.4.290.0060.02713.82
5.4.280.0060.03013.95
5.4.270.0080.02913.56
5.4.260.0060.03213.57
5.4.250.0100.02713.63
5.4.240.0060.03313.95
5.4.230.0070.03113.78
5.4.220.0100.02813.78
5.4.210.0090.02613.74
5.4.200.0050.02813.72
5.4.190.0080.02713.56
5.4.180.0110.02413.59
5.4.170.0090.02613.65
5.4.160.0100.02713.62
5.4.150.0070.02513.63
5.4.140.0070.02712.91
5.4.130.0050.03012.89
5.4.120.0050.02912.84
5.4.110.0080.02712.85
5.4.100.0110.02512.88
5.4.90.0060.02912.77
5.4.80.0040.03012.84
5.4.70.0080.02812.92
5.4.60.0050.02812.82
5.4.50.0120.02312.72
5.4.40.0060.02912.84
5.4.30.0100.02512.90
5.4.20.0040.03012.86
5.4.10.0120.02512.84
5.4.00.0050.03012.62
5.3.290.0090.02311.67
5.3.280.0070.02211.62
5.3.270.0110.02611.66
5.3.260.0060.02911.59
5.3.250.0030.03111.65
5.3.240.0110.02311.63
5.3.230.0070.02811.54
5.3.220.0090.02511.61
5.3.210.0060.02911.60
5.3.200.0060.02711.62
5.3.190.0070.02411.65
5.3.180.0040.02511.71
5.3.170.0060.02811.73
5.3.160.0070.02711.63
5.3.150.0060.02911.65
5.3.140.0070.02811.62
5.3.130.0120.02511.67
5.3.120.0070.02911.60
5.3.110.0070.03011.65
5.3.100.0060.02911.52
5.3.90.0070.03011.49
5.3.80.0060.02511.40
5.3.70.0060.02611.37
5.3.60.0060.02811.52
5.3.50.0060.02711.46
5.3.40.0030.03011.32
5.3.30.0070.02911.36
5.3.20.0070.02711.32
5.3.10.0070.02511.25
5.3.00.0080.02811.26
5.2.170.0050.01511.10
5.2.160.0050.01611.08
5.2.150.0080.01810.17
5.2.140.0040.02610.14
5.2.130.0040.02510.16
5.2.120.0050.02310.20
5.2.110.0060.02110.21
5.2.100.0050.02310.17
5.2.90.0050.01510.17
5.2.80.0030.02710.12
5.2.70.0050.02310.12
5.2.60.0080.01610.15
5.2.50.0070.02010.08
5.2.40.0070.01710.18
5.2.30.0050.02010.04
5.2.20.0060.02210.08
5.2.10.0050.02110.01
5.2.00.0030.0229.94
5.1.60.0030.0209.74
5.1.50.0040.0189.74
5.1.40.0060.0219.73
5.1.30.0110.0199.84
5.1.20.0050.0209.84
5.1.10.0090.0179.78
5.1.00.0050.0229.73
5.0.50.0050.0169.73
5.0.40.0060.0159.73
5.0.30.0080.0219.73
5.0.20.0040.0179.73
5.0.10.0030.0179.73
5.0.00.0030.0229.73
4.4.90.0030.0149.73
4.4.80.0020.0169.73
4.4.70.0050.0129.73
4.4.60.0020.0159.73
4.4.50.0060.0119.73
4.4.40.0010.0239.73
4.4.30.0050.0129.73
4.4.20.0040.0139.73
4.4.10.0080.0089.73
4.4.00.0010.0219.73
4.3.110.0030.0149.73
4.3.100.0020.0139.73
4.3.90.0040.0139.73
4.3.80.0010.0209.73
4.3.70.0050.0129.73
4.3.60.0030.0149.73
4.3.50.0040.0129.73
4.3.40.0040.0179.73
4.3.30.0040.0149.73
4.3.20.0040.0149.73
4.3.10.0060.0099.73
4.3.00.0040.0149.73

preferences:
37.35 ms | 401 KiB | 5 Q