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(); 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.0090.00918.56
8.3.50.0090.00922.05
8.3.40.0040.01118.70
8.3.30.0040.01118.79
8.3.20.0030.00518.85
8.3.10.0040.00420.66
8.3.00.0040.00419.51
8.2.180.0070.00716.75
8.2.170.0120.00322.96
8.2.160.0080.00622.16
8.2.150.0090.00024.18
8.2.140.0070.00024.66
8.2.130.0020.00526.16
8.2.120.0060.00319.89
8.2.110.0080.00320.94
8.2.100.0040.00817.83
8.2.90.0040.00419.17
8.2.80.0000.00918.05
8.2.70.0030.00517.63
8.2.60.0040.00417.68
8.2.50.0040.00418.07
8.2.40.0000.00818.34
8.2.30.0040.00419.83
8.2.20.0040.00417.79
8.2.10.0040.00417.87
8.2.00.0040.00417.93
8.1.280.0110.00325.92
8.1.270.0070.00023.99
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0140.00322.60
8.1.230.0090.00320.88
8.1.220.0040.00418.77
8.1.210.0050.00318.95
8.1.200.0060.00317.34
8.1.190.0030.00617.52
8.1.180.0070.00018.10
8.1.170.0000.00818.86
8.1.160.0070.00018.80
8.1.150.0070.00018.55
8.1.140.0070.00017.33
8.1.130.0000.00717.88
8.1.120.0000.00817.48
8.1.110.0050.00217.52
8.1.100.0000.00717.35
8.1.90.0040.00417.39
8.1.80.0050.00217.48
8.1.70.0070.00017.39
8.1.60.0000.00717.55
8.1.50.0040.00417.47
8.1.40.0000.00817.54
8.1.30.0030.00517.60
8.1.20.0050.00317.58
8.1.10.0040.00417.52
8.1.00.0030.00617.41
8.0.300.0070.00019.95
8.0.290.0070.00016.75
8.0.280.0040.00418.42
8.0.270.0000.00718.13
8.0.260.0000.00717.18
8.0.250.0040.00417.02
8.0.240.0070.00316.90
8.0.230.0070.00017.06
8.0.220.0070.00016.96
8.0.210.0030.00516.93
8.0.200.0050.00316.98
8.0.190.0050.00216.96
8.0.180.0000.00716.92
8.0.170.0030.00616.89
8.0.160.0000.00817.05
8.0.150.0000.00816.81
8.0.140.0030.00716.91
8.0.130.0060.00013.41
8.0.120.0000.00716.80
8.0.110.0060.00316.84
8.0.100.0040.00416.86
8.0.90.0040.00416.83
8.0.80.0150.00016.91
8.0.70.0040.00416.84
8.0.60.0030.00517.01
8.0.50.0050.00316.78
8.0.30.0070.01317.24
8.0.20.0080.01117.40
8.0.10.0030.00517.15
8.0.00.0080.01316.76
7.4.330.0020.00214.77
7.4.320.0000.00616.37
7.4.300.0000.00616.52
7.4.290.0040.00416.61
7.4.280.0000.00716.51
7.4.270.0040.00416.59
7.4.260.0050.00013.35
7.4.250.0060.00316.58
7.4.240.0030.00316.56
7.4.230.0000.00716.68
7.4.220.0190.00616.67
7.4.210.0080.01016.53
7.4.200.0000.00816.59
7.4.190.0030.00316.47
7.4.160.0080.00816.41
7.4.150.0070.01817.40
7.4.140.0090.01017.86
7.4.130.0060.01316.54
7.4.120.0130.00516.55
7.4.110.0130.00616.62
7.4.100.0060.01316.50
7.4.90.0080.00916.65
7.4.80.0120.00619.04
7.4.70.0180.00016.42
7.4.60.0060.01016.72
7.4.50.0000.00516.63
7.4.40.0000.01822.27
7.4.30.0130.00916.67
7.4.10.0110.00514.98
7.4.00.0090.00814.82
7.3.330.0000.00613.23
7.3.320.0030.00313.16
7.3.310.0030.00616.46
7.3.300.0000.00716.37
7.3.290.0100.00316.37
7.3.280.0090.00716.35
7.3.270.0040.01317.40
7.3.260.0110.00818.24
7.3.250.0050.01416.39
7.3.240.0140.00316.62
7.3.230.0060.01116.39
7.3.210.0110.00716.46
7.3.200.0090.00819.39
7.3.190.0170.00516.31
7.3.180.0110.01116.49
7.3.170.0070.01016.57
7.3.160.0040.01216.45
7.3.130.0050.01314.77
7.3.120.0080.00914.91
7.3.110.0080.01114.82
7.3.100.0080.00814.83
7.3.90.0030.01114.86
7.3.80.0050.00715.03
7.3.70.0060.00314.82
7.3.60.0070.00714.89
7.3.50.0050.01214.78
7.3.40.0020.01014.81
7.3.30.0070.00514.81
7.3.20.0040.01016.59
7.3.10.0060.00816.60
7.3.00.0030.00616.57
7.2.330.0120.00616.58
7.2.320.0090.00916.82
7.2.310.0060.01216.79
7.2.300.0100.01016.67
7.2.290.0130.00316.80
7.2.260.0100.01015.21
7.2.250.0070.01115.22
7.2.240.0030.01315.10
7.2.230.0080.00615.00
7.2.220.0080.00615.11
7.2.210.0050.00915.03
7.2.200.0050.01014.83
7.2.190.0050.01115.18
7.2.180.0020.01215.15
7.2.170.0050.00915.08
7.2.160.0050.01015.14
7.2.150.0080.00816.86
7.2.140.0030.00816.89
7.2.130.0030.01116.85
7.2.120.0040.01116.89
7.2.110.0050.00816.78
7.2.100.0080.00516.94
7.2.90.0060.01117.03
7.2.80.0020.01516.92
7.2.70.0080.00517.00
7.2.60.0060.00516.85
7.2.50.0050.00916.87
7.2.40.0020.01316.91
7.2.30.0080.00716.97
7.2.20.0090.00516.98
7.2.10.0060.00916.97
7.2.00.0080.00716.88
7.1.330.0070.00815.72
7.1.320.0080.00415.62
7.1.310.0020.01015.68
7.1.300.0060.01215.65
7.1.290.0030.01115.66
7.1.280.0040.00915.78
7.1.270.0050.00715.74
7.1.260.0060.00815.68
7.1.250.0060.00815.75
7.1.240.0030.00715.88
7.1.230.0050.00815.62
7.1.220.0060.00315.69
7.1.210.0050.00915.74
7.1.200.0040.00815.79
7.1.190.0050.00415.76
7.1.180.0030.00915.57
7.1.170.0070.00515.84
7.1.160.0040.00815.81
7.1.150.0050.00815.72
7.1.140.0060.00715.78
7.1.130.0030.01215.69
7.1.120.0070.00715.82
7.1.110.0070.00515.73
7.1.100.0050.00815.71
7.1.90.0050.00815.71
7.1.80.0080.00615.71
7.1.70.0070.00416.19
7.1.60.0070.00816.99
7.1.50.0070.00616.00
7.1.40.0100.00715.70
7.1.30.0050.01015.74
7.1.20.0120.00315.65
7.1.10.0040.01015.69
7.1.00.0040.03017.96
7.0.330.0070.00715.19
7.0.320.0070.00315.44
7.0.310.0070.00815.23
7.0.300.0060.00615.55
7.0.290.0030.01015.47
7.0.280.0020.01615.33
7.0.270.0060.00615.39
7.0.260.0030.01015.41
7.0.250.0030.01015.35
7.0.240.0020.01215.54
7.0.230.0040.00915.41
7.0.220.0090.00615.48
7.0.210.0040.01115.33
7.0.200.0060.00516.02
7.0.190.0030.00715.36
7.0.180.0050.00915.44
7.0.170.0060.00715.40
7.0.160.0040.00915.46
7.0.150.0040.00615.50
7.0.140.0030.03117.68
7.0.130.0040.00615.55
7.0.120.0070.00715.51
7.0.110.0070.00915.33
7.0.100.0070.00515.51
7.0.90.0050.00815.33
7.0.80.0050.00715.36
7.0.70.0080.00615.51
7.0.60.0060.02016.85
7.0.50.0050.01616.33
7.0.40.0070.03114.95
7.0.30.0050.03314.94
7.0.20.0040.02114.95
7.0.10.0050.02014.95
7.0.00.0060.03214.82
5.6.400.0050.00614.55
5.6.390.0060.00314.74
5.6.380.0050.00414.65
5.6.370.0070.00514.67
5.6.360.0060.00714.66
5.6.350.0080.00814.61
5.6.340.0040.00914.31
5.6.330.0080.00914.65
5.6.320.0020.01414.51
5.6.310.0040.00514.36
5.6.300.0050.00714.72
5.6.290.0060.00614.32
5.6.280.0060.02816.43
5.6.270.0040.01314.39
5.6.260.0030.01314.56
5.6.250.0060.00814.61
5.6.240.0030.01014.40
5.6.230.0050.00714.34
5.6.220.0090.00314.35
5.6.210.0070.02416.40
5.6.200.0030.02115.74
5.6.190.0070.03215.68
5.6.180.0050.01915.67
5.6.170.0050.02315.61
5.6.160.0090.02415.72
5.6.150.0020.03315.66
5.6.140.0060.02715.65
5.6.130.0050.03215.65
5.6.120.0090.02915.63
5.6.110.0070.02215.63
5.6.100.0070.01915.77
5.6.90.0070.02015.71
5.6.80.0050.02815.47
5.6.70.0070.01615.42
5.6.60.0060.02815.50
5.6.50.0120.01915.46
5.6.40.0050.03015.34
5.6.30.0030.02915.40
5.6.20.0070.02015.43
5.6.10.0030.03215.45
5.6.00.0150.01915.38
5.5.380.0030.00814.18
5.5.370.0080.00314.43
5.5.360.0040.01314.32
5.5.350.1430.01516.30
5.5.340.0100.01515.59
5.5.330.0060.03315.58
5.5.320.0040.02015.60
5.5.310.0080.01715.60
5.5.300.0070.03115.75
5.5.290.0080.03015.64
5.5.280.0070.01715.42
5.5.270.0050.03315.52
5.5.260.0060.02715.58
5.5.250.0020.03915.54
5.5.240.0100.02315.36
5.5.230.0050.02315.26
5.5.220.0060.02615.36
5.5.210.0090.02315.37
5.5.200.0030.02215.31
5.5.190.0110.02815.23
5.5.180.0030.02715.36
5.5.170.0110.00314.29
5.5.160.0100.02715.32
5.5.150.0030.03115.38
5.5.140.0090.02715.36
5.5.130.0050.03215.39
5.5.120.0090.02715.14
5.5.110.0040.02615.18
5.5.100.0090.02815.23
5.5.90.0060.02815.16
5.5.80.0050.02615.22
5.5.70.0130.02215.28
5.5.60.0030.03015.12
5.5.50.0030.02415.33
5.5.40.0030.01915.12
5.5.30.0050.03015.37
5.5.20.0090.01315.33
5.5.10.0080.02415.24
5.5.00.0080.01615.29
5.4.450.0050.02813.73
5.4.440.0040.03013.84
5.4.430.0030.02113.78
5.4.420.0020.03613.93
5.4.410.0050.01613.98
5.4.400.0020.03013.60
5.4.390.0030.02013.72
5.4.380.0110.02613.63
5.4.370.0060.01613.69
5.4.360.0050.02113.75
5.4.350.0010.03213.83
5.4.340.0080.02013.65
5.4.330.0020.00811.05
5.4.320.0060.02813.70
5.4.310.0080.02613.81
5.4.300.0080.02613.63
5.4.290.0030.02813.81
5.4.280.0060.02713.75
5.4.270.0070.02613.77
5.4.260.0030.02313.70
5.4.250.0050.02213.87
5.4.240.0050.03013.85
5.4.230.0080.02413.63
5.4.220.0040.02213.46
5.4.210.0040.02913.54
5.4.200.0060.02613.87
5.4.190.0050.01413.84
5.4.180.0020.02513.77
5.4.170.0060.02813.80
5.4.160.0060.02613.73
5.4.150.0090.01513.71
5.4.140.0080.02712.90
5.4.130.0030.02112.79
5.4.120.0050.01812.84
5.4.110.0040.02012.88
5.4.100.0050.01412.74
5.4.90.0060.02612.84
5.4.80.0020.02512.79
5.4.70.0010.02712.89
5.4.60.0020.02213.04
5.4.50.0070.02212.92
5.4.40.0040.02013.00
5.4.30.0030.02912.96
5.4.20.0030.01712.93
5.4.10.0040.02812.82
5.4.00.0090.02412.61
5.3.290.0040.02011.63
5.3.280.0060.01711.54
5.3.270.0020.02111.65
5.3.260.0050.02711.60
5.3.250.0050.01911.62
5.3.240.0060.02211.54
5.3.230.0050.02111.61
5.3.220.0010.01911.50
5.3.210.0020.02311.52
5.3.200.0030.01611.52
5.3.190.0040.02911.63
5.3.180.0030.03011.66
5.3.170.0050.01911.69
5.3.160.0050.01511.58
5.3.150.0050.01411.78
5.3.140.0060.02711.68
5.3.130.0050.02911.71
5.3.120.0020.02611.54
5.3.110.0060.01511.66
5.3.100.0040.01811.52
5.3.90.0040.02811.53
5.3.80.0030.02811.47
5.3.70.0030.02811.44
5.3.60.0040.01611.41
5.3.50.0040.03111.32
5.3.40.0050.02311.50
5.3.30.0060.02511.36
5.3.20.0010.01711.34
5.3.10.0030.01511.17
5.3.00.0060.01911.14
5.2.170.0030.04311.13
5.2.160.0030.04011.06
5.2.150.0070.06311.13
5.2.140.0030.03311.13
5.2.130.0030.06711.08
5.2.120.0070.03011.09
5.2.110.0100.05311.13
5.2.100.0000.03011.07
5.2.90.0070.02311.24
5.2.80.0000.04011.23
5.2.70.0030.03010.92
5.2.60.0000.03710.83
5.2.50.0030.03310.91
5.2.40.0030.05710.78
5.2.30.0000.03310.94
5.2.20.0030.03010.96
5.2.10.0030.06010.90
5.2.00.0100.05310.72
5.1.60.0030.0579.97
5.1.50.0100.0279.85
5.1.40.0000.0439.96
5.1.30.0000.04010.28
5.1.20.0030.05710.30
5.1.10.0030.02710.14
5.1.00.0070.04010.09
5.0.50.0030.0478.45
5.0.40.0030.0238.32
5.0.30.0030.0308.29
5.0.20.0000.0408.25
5.0.10.0070.0208.20
5.0.00.0000.0707.98
4.4.90.0030.0137.77
4.4.80.0000.0237.77
4.4.70.0030.0307.77
4.4.60.0000.0407.77
4.4.50.0070.0307.77
4.4.40.0070.0377.77
4.4.30.0030.0237.77
4.4.20.0030.0207.77
4.4.10.0000.0177.77
4.4.00.0100.0477.77
4.3.110.0000.0377.77
4.3.100.0030.0337.77
4.3.90.0030.0277.77
4.3.80.0000.0377.77
4.3.70.0070.0307.77
4.3.60.0000.0377.77
4.3.50.0000.0377.77
4.3.40.0000.0537.77
4.3.30.0030.0237.77
4.3.20.0030.0337.77
4.3.10.0000.0277.77
4.3.00.0000.0377.77

preferences:
42.43 ms | 400 KiB | 5 Q