3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait setData { static function setData( $data ) { DataCollector::collectedData( 'set', $data ); } } trait dataHandler { use setData; static function getCollectedData() { DataCollector::collectedData( 'get' ); } private static function collectedData( $type, $value = NULL ) { if( strtolower( $type ) === 'set' ) { $CollectionData[] = $value; var_dump($CollectionData); } elseif( strtolower( $type ) === 'get' ) return self::$CollectionData; } } class DataCollector { use dataHandler { collectedData as public; } private static $CollectionData = array(); } class Form { use setData {} } class Field extends Form { public function __construct( $type, $text = NULL ) { DataCollector::setData( $type ); } } class A { use setData{} public function __construct( $type, $text = NULL ) { self::setData( $type ); } } $Field1 = new Field( '1' ); $Field2 = new Field( '2' ); $A = new A( '3' ); DataCollector::setData('4'); dataHandler::setData('5'); var_dump( 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.00316.88
8.3.50.0130.00822.18
8.3.40.0170.00318.96
8.3.30.0120.00319.04
8.3.20.0080.00020.16
8.3.10.0060.00323.61
8.3.00.0080.00319.26
8.2.180.0100.01018.41
8.2.170.0140.00722.96
8.2.160.0100.00320.19
8.2.150.0120.00624.18
8.2.140.0040.00424.66
8.2.130.0100.00326.16
8.2.120.0040.00422.25
8.2.110.0090.00019.39
8.2.100.0000.01219.76
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0040.00418.16
8.2.30.0000.00718.15
8.2.20.0040.00417.65
8.2.10.0040.00417.77
8.2.00.0000.00817.64
8.1.280.0110.00725.92
8.1.270.0060.00323.72
8.1.260.0080.00326.35
8.1.250.0060.00328.09
8.1.240.0090.00020.86
8.1.230.0040.00717.46
8.1.220.0030.00617.79
8.1.210.0030.00518.77
8.1.200.0090.00017.47
8.1.190.0050.00317.41
8.1.180.0030.00518.10
8.1.170.0080.00018.47
8.1.160.0070.00021.90
8.1.150.0040.00418.57
8.1.140.0000.00817.47
8.1.130.0040.00417.41
8.1.120.0030.00517.48
8.1.110.0000.00817.38
8.1.100.0050.00317.33
8.1.90.0000.00717.45
8.1.80.0030.00317.47
8.1.70.0040.00417.44
8.1.60.0060.00317.57
8.1.50.0030.00617.42
8.1.40.0080.00017.48
8.1.30.0090.00017.55
8.1.20.0040.00417.57
8.1.10.0000.00817.48
8.1.00.0040.00417.50
8.0.300.0040.00418.77
8.0.290.0020.00516.63
8.0.280.0070.00018.55
8.0.270.0050.00316.81
8.0.260.0040.00416.88
8.0.250.0000.00717.02
8.0.240.0030.00316.99
8.0.230.0070.00416.99
8.0.220.0000.00716.82
8.0.210.0040.00416.87
8.0.200.0030.00317.00
8.0.190.0090.00016.91
8.0.180.0050.00316.92
8.0.170.0020.00516.96
8.0.160.0050.00216.88
8.0.150.0040.00416.92
8.0.140.0070.00016.82
8.0.130.0060.00013.38
8.0.120.0060.00316.77
8.0.110.0050.00216.97
8.0.100.0000.00716.98
8.0.90.0070.00016.83
8.0.80.0100.00716.88
8.0.70.0050.00316.92
8.0.60.0040.00416.75
8.0.50.0040.00416.98
8.0.30.0130.00717.26
8.0.20.0100.01017.40
8.0.10.0000.00816.93
8.0.00.0040.01316.79
7.4.330.0030.00315.08
7.4.320.0030.00316.44
7.4.300.0040.00416.60
7.4.290.0030.00316.52
7.4.280.0000.00716.60
7.4.270.0000.00716.54
7.4.260.0000.00716.63
7.4.250.0040.00416.38
7.4.240.0020.00516.49
7.4.230.0000.00716.65
7.4.220.0190.00016.66
7.4.210.0070.00716.59
7.4.200.0070.00016.58
7.4.190.0000.00716.76
7.4.160.0120.00416.34
7.4.150.0120.00717.40
7.4.140.0100.00817.86
7.4.130.0080.01116.50
7.4.120.0030.01416.46
7.4.110.0140.00316.57
7.4.100.0130.00616.63
7.4.90.0100.00616.72
7.4.80.0120.00619.39
7.4.70.0140.00316.52
7.4.60.0130.00416.42
7.4.50.0040.00416.57
7.4.40.0090.00322.77
7.4.30.0060.01016.43
7.4.00.0150.00114.78
7.3.330.0030.00313.10
7.3.320.0050.00013.28
7.3.310.0000.00716.28
7.3.300.0000.00716.24
7.3.290.0150.00616.32
7.3.280.0050.01316.39
7.3.270.0060.01217.40
7.3.260.0120.00616.45
7.3.250.0080.01016.47
7.3.240.0080.01116.31
7.3.230.0090.00916.41
7.3.210.0150.00316.30
7.3.200.0180.00319.39
7.3.190.0110.00816.38
7.3.180.0080.00816.32
7.3.170.0120.00416.34
7.3.160.0090.00916.21
7.3.120.0070.01014.98
7.3.110.0060.01114.74
7.3.100.0070.00914.75
7.3.90.0050.00814.91
7.3.80.0080.00414.82
7.3.70.0050.00914.95
7.3.60.0050.00714.71
7.3.50.0090.00414.71
7.3.40.0030.01014.93
7.3.30.0060.00814.66
7.3.20.0060.00616.55
7.3.10.0010.01016.51
7.3.00.0090.00516.61
7.2.330.0120.00616.46
7.2.320.0080.00816.79
7.2.310.0130.00516.67
7.2.300.0110.00616.42
7.2.290.0210.00416.74
7.2.250.0030.01414.96
7.2.240.0050.01315.08
7.2.230.0030.01314.93
7.2.220.0050.01014.91
7.2.210.0100.00515.26
7.2.200.0050.01215.07
7.2.190.0030.01015.10
7.2.180.0030.00915.19
7.2.170.0080.00615.05
7.2.160.0100.00714.92
7.2.150.0060.00617.10
7.2.140.0070.01016.93
7.2.130.0070.01017.05
7.2.120.0030.01217.05
7.2.110.0040.01116.95
7.2.100.0000.01316.96
7.2.90.0090.00916.93
7.2.80.0070.01017.05
7.2.70.0070.01017.04
7.2.60.0140.00016.94
7.2.50.0000.01217.02
7.2.40.0030.00717.16
7.2.30.0040.01117.09
7.2.20.0090.00316.98
7.2.10.0060.01217.01
7.2.00.0080.00618.18
7.1.330.0050.01115.74
7.1.320.0080.00715.70
7.1.310.0070.00515.88
7.1.300.0030.00615.59
7.1.290.0060.00315.80
7.1.280.0060.00815.68
7.1.270.0050.00815.71
7.1.260.0050.00715.63
7.1.250.0070.01016.05
7.1.240.0040.00715.74
7.1.230.0030.01315.91
7.1.220.0040.01015.57
7.1.210.0120.00415.80
7.1.200.0050.00715.60
7.1.190.0000.01415.70
7.1.180.0100.00315.54
7.1.170.0100.00415.86
7.1.160.0080.00415.50
7.1.150.0040.00915.80
7.1.140.0140.00015.94
7.1.130.0040.01215.83
7.1.120.0000.01415.71
7.1.110.0030.00915.97
7.1.100.0030.01017.11
7.1.90.0060.00615.57
7.1.80.0030.01015.80
7.1.70.0020.01216.47
7.1.60.0090.00817.52
7.1.50.0090.00916.46
7.1.40.0060.00315.39
7.1.30.0090.00015.73
7.1.20.0030.00815.53
7.1.10.0000.01315.73
7.1.00.0030.04218.94
7.0.330.0050.00515.41
7.0.320.0060.00915.46
7.0.310.0040.00815.36
7.0.300.0050.00315.54
7.0.290.0060.00615.19
7.0.280.0040.01115.44
7.0.270.0000.01515.63
7.0.260.0120.00015.49
7.0.250.0040.01115.58
7.0.240.0040.00815.59
7.0.230.0030.00615.43
7.0.220.0060.00315.45
7.0.210.0000.00915.46
7.0.200.0040.00516.15
7.0.190.0040.01215.21
7.0.180.0060.00615.33
7.0.170.0100.00315.57
7.0.160.0090.00015.54
7.0.150.0090.00615.40
7.0.140.0030.04118.79
7.0.130.0120.00315.59
7.0.120.0030.01715.65
7.0.110.0100.00615.50
7.0.100.0030.03617.71
7.0.90.0190.02917.80
7.0.80.0150.04817.71
7.0.70.0250.04117.69
7.0.60.0070.02517.71
7.0.50.0270.03017.88
7.0.40.0030.05116.86
7.0.30.0110.04116.68
7.0.20.0100.04516.82
7.0.10.0100.03616.81
7.0.00.0080.03816.87
5.6.400.0030.00614.46
5.6.390.0070.00714.76
5.6.380.0120.00314.31
5.6.370.0040.01114.65
5.6.360.0100.00314.46
5.6.350.0050.00514.59
5.6.340.0030.00914.55
5.6.330.0060.00314.58
5.6.320.0000.01614.45
5.6.310.0030.01014.32
5.6.300.0060.00614.25
5.6.290.0000.01214.63
5.6.280.0070.03817.84
5.6.270.0060.01314.47
5.6.260.0040.01114.48
5.6.250.0060.02517.59
5.6.240.0080.04217.46
5.6.230.0080.03917.65
5.6.220.0050.04517.55
5.6.210.0160.03517.57
5.6.200.0020.05017.87
5.6.190.0080.03817.68
5.6.180.0070.04617.73
5.6.170.0070.04017.75
5.6.160.0100.04217.85
5.6.150.0050.04317.65
5.6.140.0050.03817.67
5.6.130.0060.02517.68
5.6.120.0050.04817.86
5.6.110.0100.04317.83
5.6.100.0020.03217.78
5.6.90.0080.04617.53
5.6.80.0100.04217.30
5.6.70.0100.04517.25
5.6.60.0080.03817.38
5.6.50.0080.03817.37
5.6.40.0060.02817.30
5.6.30.0060.03317.35
5.6.20.0080.02517.51
5.6.10.0050.02817.30
5.6.00.0080.03717.37
5.5.380.0100.03417.31
5.5.370.0080.04317.27
5.5.360.0070.02917.45
5.5.350.0080.03217.59
5.5.340.0080.02517.54
5.5.330.0020.03117.75
5.5.320.0130.04017.64
5.5.310.0030.04317.62
5.5.300.0120.04017.53
5.5.290.0030.05317.55
5.5.280.0020.03017.68
5.5.270.0100.04217.46
5.5.260.0100.02517.73
5.5.250.0050.02817.44
5.5.240.0040.02917.21
5.5.230.0050.04517.10
5.5.220.0060.02417.30
5.5.210.0100.04117.10
5.5.200.0070.03717.26
5.5.190.0050.02517.06
5.5.180.0020.02617.30
5.5.170.0030.01214.39
5.5.160.0050.03717.23
5.5.150.0020.04517.28
5.5.140.0050.02817.28
5.5.130.0050.04717.22
5.5.120.0050.02817.31
5.5.110.0120.02217.14
5.5.100.0080.03817.17
5.5.90.0070.02917.00
5.5.80.0070.03217.34
5.5.70.0080.03817.26
5.5.60.0050.03817.27
5.5.50.0020.03317.10
5.5.40.0120.03817.10
5.5.30.0120.03817.10
5.5.20.0070.03517.04
5.5.10.0110.03817.11
5.5.00.0050.04717.15
5.4.450.0080.03616.08
5.4.440.0080.03616.05
5.4.430.0050.04316.06
5.4.420.0070.03516.03
5.4.410.0080.03816.01
5.4.400.0130.03815.95
5.4.390.0100.03015.78
5.4.380.0030.04715.86
5.4.370.0050.04215.79
5.4.360.0120.03815.78
5.4.350.0050.04015.87
5.4.340.0080.02015.91
5.4.330.0080.00012.68
5.4.320.0050.02515.84
5.4.310.0070.04215.77
5.4.300.0130.03315.86
5.4.290.0050.03815.78
5.4.280.0060.01915.77
5.4.270.0070.02515.86
5.4.260.0050.02915.86
5.4.250.0070.04015.92
5.4.240.0120.02815.86
5.4.230.0080.02415.92
5.4.220.0120.03715.79
5.4.210.0060.04615.91
5.4.200.0120.03715.81
5.4.190.0130.03315.86
5.4.180.0040.02615.96
5.4.170.0100.03015.95
5.4.160.0070.04015.89
5.4.150.0120.03715.88
5.4.140.0070.03814.62
5.4.130.0030.04214.57
5.4.120.0060.04014.58
5.4.110.0110.03614.54
5.4.100.0070.03914.59
5.4.90.0050.04114.63
5.4.80.0020.03914.57
5.4.70.0020.04214.57
5.4.60.0050.02014.57
5.4.50.0050.03614.51
5.4.40.0150.02814.54
5.4.30.0050.02514.58
5.4.20.0080.04014.56
5.4.10.0020.02914.58
5.4.00.0090.03914.29
5.3.290.0050.04113.65
5.3.280.0050.03813.63
5.3.270.0070.03813.58
5.3.260.0030.04513.64
5.3.250.0050.04313.64
5.3.240.0030.04013.65
5.3.230.0060.02713.63
5.3.220.0090.02413.60
5.3.210.0070.03613.62
5.3.200.0070.04213.63
5.3.190.0020.03913.63
5.3.180.0050.04113.54
5.3.170.0090.03513.54
5.3.160.0110.01813.62
5.3.150.0100.03613.54
5.3.140.0040.04413.61
5.3.130.0080.03113.61
5.3.120.0050.02713.61
5.3.110.0060.03613.60
5.3.100.0050.02413.29
5.3.90.0050.04013.36
5.3.80.0080.03213.24
5.3.70.0120.01813.34
5.3.60.0050.03613.24
5.3.50.0030.02513.29
5.3.40.0050.02313.19
5.3.30.0090.03713.18
5.3.20.0040.02213.16
5.3.10.0050.03013.17
5.3.00.0050.04013.14
5.2.170.0070.06311.13
5.2.160.0030.04711.18
5.2.150.0030.03311.05
5.2.140.0100.02711.18
5.2.130.0000.04011.02
5.2.120.0070.06010.89
5.2.110.0070.04011.13
5.2.100.0030.03011.06
5.2.90.0030.06310.93
5.2.80.0130.04311.09
5.2.70.0100.05711.16
5.2.60.0070.06010.88
5.2.50.0200.05011.09
5.2.40.0070.03711.01
5.2.30.0070.03310.82
5.2.20.0100.04710.98
5.2.10.0030.02710.77
5.2.00.0070.03010.63
5.1.60.0030.0509.87
5.1.50.0030.04710.07
5.1.40.0030.0379.99
5.1.30.0000.03010.28
5.1.20.0000.03710.38
5.1.10.0070.0339.91
5.1.00.0030.03710.05
5.0.50.0070.0208.38
5.0.40.0070.0308.29
5.0.30.0030.0308.22
5.0.20.0030.0438.29
5.0.10.0000.0208.23
5.0.00.0100.0538.25
4.4.90.0000.0178.22
4.4.80.0070.0338.22
4.4.70.0000.0208.22
4.4.60.0000.0238.22
4.4.50.0000.0208.22
4.4.40.0030.0508.22
4.4.30.0000.0338.22
4.4.20.0030.0378.22
4.4.10.0000.0208.22
4.4.00.0070.0238.22
4.3.110.0070.0278.22
4.3.100.0030.0238.22
4.3.90.0000.0178.22
4.3.80.0030.0538.22
4.3.70.0000.0208.22
4.3.60.0030.0278.22
4.3.50.0030.0338.22
4.3.40.0000.0508.22
4.3.30.0000.0378.22
4.3.20.0000.0378.22
4.3.10.0030.0208.22
4.3.00.0030.0338.22

preferences:
47.98 ms | 401 KiB | 5 Q