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() { return DataCollector::collectedData( 'get' ); } private static function collectedData( $type, $value = NULL ) { if( strtolower( $type ) === 'set' ) { DataCollector::$CollectionData[] = $value; var_dump( DataCollector::$CollectionData ); } elseif( strtolower( $type ) === 'get' ) return DataCollector::$CollectionData; } } class DataCollector { use dataHandler { collectedData as public; } private static $CollectionData = array(); public function __construct() { return $this; } } class Form { use setData {} } class Field extends Form { public function __construct( $type, $text = NULL ) { $this->setData( $type ); } } class A { use setData{} public function __construct( $type, $text = NULL ) { $this->setData( $type ); } } $Field1 = new Field( '1' ); $Field2 = new Field( '2' ); $A = new A( '3' ); #DataCollector::setData('4'); #dataHandler::setData('5'); var_dump( DataCollector::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.00716.63
8.3.50.0120.00718.35
8.3.40.0070.00718.77
8.3.30.0090.00618.71
8.3.20.0040.00418.65
8.3.10.0000.00920.48
8.3.00.0000.00819.29
8.2.180.0090.01216.50
8.2.170.0110.00422.96
8.2.160.0140.00019.46
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0050.00318.94
8.2.110.0090.00319.31
8.2.100.0120.00018.03
8.2.90.0000.00819.40
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0040.00417.93
8.2.50.0040.00419.47
8.2.40.0040.00417.99
8.2.30.0000.00918.18
8.2.20.0060.00317.85
8.2.10.0070.00017.67
8.2.00.0040.00417.74
8.1.280.0100.00725.92
8.1.270.0000.00824.66
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00321.31
8.1.230.0040.00817.50
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0050.00517.35
8.1.190.0050.00317.36
8.1.180.0080.00018.10
8.1.170.0080.00018.75
8.1.160.0040.00418.80
8.1.150.0000.00818.63
8.1.140.0030.00617.38
8.1.130.0030.00317.44
8.1.120.0040.00417.38
8.1.110.0040.00417.52
8.1.100.0000.00717.38
8.1.90.0000.00717.35
8.1.80.0080.00017.48
8.1.70.0000.00717.43
8.1.60.0040.00417.60
8.1.50.0040.00417.45
8.1.40.0090.00017.43
8.1.30.0050.00317.55
8.1.20.0000.00717.70
8.1.10.0030.00617.55
8.1.00.0040.00417.52
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0000.00718.50
8.0.270.0000.00717.26
8.0.260.0030.00316.83
8.0.250.0000.00716.93
8.0.240.0030.00716.93
8.0.230.0030.00316.82
8.0.220.0030.00316.91
8.0.210.0040.00416.80
8.0.200.0070.00016.99
8.0.190.0050.00216.99
8.0.180.0040.00416.91
8.0.170.0050.00316.75
8.0.160.0000.00716.91
8.0.150.0030.00616.75
8.0.140.0040.00416.69
8.0.130.0050.00013.32
8.0.120.0040.00416.83
8.0.110.0040.00416.85
8.0.100.0030.00516.79
8.0.90.0090.00016.92
8.0.80.0180.00416.88
8.0.70.0000.00716.85
8.0.60.0070.00016.88
8.0.50.0070.00016.91
8.0.30.0090.01317.22
8.0.20.0080.01217.25
8.0.10.0020.00516.96
8.0.00.0090.01016.77
7.4.330.0050.00012.98
7.4.320.0050.00216.62
7.4.300.0030.00316.51
7.4.290.0000.00616.55
7.4.280.0040.00416.46
7.4.270.0070.00016.41
7.4.260.0050.00013.32
7.4.250.0030.00516.46
7.4.240.0020.00516.60
7.4.230.0070.00016.50
7.4.220.0060.00916.55
7.4.210.0070.00716.63
7.4.200.0070.00016.30
7.4.190.0080.00016.45
7.4.160.0040.01416.32
7.4.150.0150.00616.44
7.4.140.0140.00716.53
7.4.130.0080.00916.46
7.4.120.0050.01416.48
7.4.110.0070.01016.51
7.4.100.0070.01116.41
7.4.90.0090.00916.59
7.4.80.0160.01016.52
7.4.70.0130.00916.52
7.4.60.0140.00416.54
7.4.50.0020.00216.41
7.4.40.0090.00916.44
7.4.30.0060.00916.55
7.4.00.0000.01514.99
7.3.330.0070.00013.16
7.3.320.0030.00313.32
7.3.310.0030.00316.38
7.3.300.0000.00716.34
7.3.290.0080.01016.35
7.3.280.0100.00916.35
7.3.270.0110.00816.59
7.3.260.0220.00016.63
7.3.250.0110.00816.49
7.3.240.0040.01916.43
7.3.230.0100.00716.68
7.3.210.0070.01016.29
7.3.200.0200.00319.39
7.3.190.0100.01416.63
7.3.180.0060.01516.37
7.3.170.0100.00616.28
7.3.160.0210.00016.48
7.3.120.0060.01114.92
7.3.110.0060.01014.79
7.3.100.0100.00714.62
7.3.90.0070.00714.63
7.3.80.0040.00915.18
7.3.70.0070.00714.70
7.3.60.0000.01814.92
7.3.50.0000.01714.91
7.3.40.0120.00414.93
7.3.30.0090.00614.98
7.3.20.0070.01016.48
7.3.10.0080.00816.63
7.3.00.0000.01016.37
7.2.330.0120.00616.55
7.2.320.0110.01416.74
7.2.310.0090.00916.77
7.2.300.0100.00816.89
7.2.290.0100.01016.75
7.2.250.0060.01315.32
7.2.240.0130.00715.05
7.2.230.0070.00714.91
7.2.220.0070.00715.29
7.2.210.0040.01215.34
7.2.200.0090.00614.80
7.2.190.0040.01214.97
7.2.180.0030.01315.07
7.2.170.0100.00015.03
7.2.60.0060.00917.08
7.1.330.0120.00315.89
7.1.320.0000.01515.46
7.1.310.0070.00415.79
7.1.300.0100.00715.68
7.1.290.0060.00915.38
7.1.280.0000.01215.83
7.1.270.0100.00315.67
7.1.260.0120.00315.49
7.1.200.0100.00315.81
7.1.70.0610.01015.13
7.1.60.0100.01319.33
7.1.50.0090.00317.01
7.1.00.0000.03722.31
7.0.200.0100.00314.76
7.0.140.0030.07322.00
7.0.120.0000.07322.13
7.0.60.0070.05319.96
7.0.50.0100.07717.86
7.0.40.0100.06020.18
7.0.30.0230.07320.24
7.0.20.0400.07020.18
7.0.10.0100.08320.23
7.0.00.0130.03720.07
5.6.280.0070.07020.80
5.6.210.0070.05320.66
5.6.200.0070.05318.19
5.6.190.0070.08320.52
5.6.180.0570.07020.39
5.6.170.0630.05320.34
5.6.160.0200.06720.52
5.6.150.0100.04018.29
5.6.140.0130.06018.16
5.6.130.0100.07018.23
5.6.120.0070.05721.00
5.6.110.0100.07321.04
5.6.100.0130.08021.05
5.6.90.0030.07320.99
5.6.80.0030.08320.37
5.5.350.0030.08320.46
5.5.340.0100.07317.97
5.5.330.0030.08720.21
5.5.320.0570.06320.27
5.5.310.0130.06020.34
5.5.300.0070.08017.96
5.5.290.0100.08018.04
5.5.280.0070.08720.89
5.5.270.0100.08320.88
5.5.260.0130.08020.89
5.5.250.0100.07720.56
5.5.240.0230.07320.05
5.4.450.0070.03719.47
5.4.440.0100.03319.57
5.4.430.0070.03319.48
5.4.420.0000.04019.25
5.4.410.0070.03319.36
5.4.400.0000.04018.88
5.4.390.0030.03718.87
5.4.380.0100.03019.08
5.4.370.0000.04018.87
5.4.360.0070.03319.14
5.4.350.0030.03719.14
5.4.340.0000.04019.10
5.4.320.0030.03718.88
5.4.310.0070.04319.12
5.4.300.0070.04019.00
5.4.290.0070.04019.24
5.4.280.0200.06319.14
5.4.270.0070.07719.20
5.4.260.0100.07019.16
5.4.250.0030.07018.86
5.4.240.0000.04719.25
5.4.230.0130.06018.93
5.4.220.0100.07318.83
5.4.210.0130.06718.92
5.4.200.0070.04019.15
5.4.190.0030.06318.91
5.4.180.0030.04318.84
5.4.170.0030.05319.23
5.4.160.0100.07318.98
5.4.150.0030.08018.85
5.4.140.0030.05016.46
5.4.130.0170.06016.55
5.4.120.0030.06716.46
5.4.110.0100.05316.52
5.4.100.0070.05716.44
5.4.90.0070.05716.32
5.4.80.0100.03016.47
5.4.70.0130.06716.53
5.4.60.0030.05016.31
5.4.50.0100.03716.38
5.4.40.0100.07016.36
5.4.30.0130.05716.31
5.4.20.0070.03716.30
5.4.10.0070.03716.66
5.4.00.0000.04015.90
5.3.290.0000.04014.65
5.3.280.0000.07314.52
5.3.270.0000.05014.53
5.3.260.0070.04714.43
5.3.250.0100.07314.48
5.3.240.0070.07314.42
5.3.230.0200.06314.54
5.3.220.0000.05014.58
5.3.210.0170.06014.55
5.3.200.0070.07014.50
5.3.190.0000.08314.66
5.3.180.0000.05014.45
5.3.170.0100.03314.49
5.3.160.0030.07714.38
5.3.150.0030.06014.58
5.3.140.0030.07714.52
5.3.130.0000.04714.34
5.3.120.0030.05714.45
5.3.110.0070.06714.43
5.3.100.0100.04013.97
5.3.90.0030.07713.86
5.3.80.0070.05014.03
5.3.70.0100.05713.95
5.3.60.0000.08013.82
5.3.50.0070.07313.87
5.3.40.0030.08013.87
5.3.30.0170.04713.88
5.3.20.0070.04713.61
5.3.10.0200.02713.67
5.3.00.0000.03713.45
5.2.170.0030.05311.02
5.2.160.0030.05711.30
5.2.150.0100.04311.23
5.2.140.0030.03011.04
5.2.130.0030.02710.92
5.2.120.0030.03711.07
5.2.110.0000.03011.18
5.2.100.0030.03311.19
5.2.90.0000.06310.93
5.2.80.0030.03011.18
5.2.70.0000.07011.02
5.2.60.0030.06710.90
5.2.50.0030.06311.09
5.2.40.0070.06010.97
5.2.30.0070.05310.81
5.2.20.0000.03710.95
5.2.10.0000.05010.89
5.2.00.0000.04310.77
5.1.60.0030.05310.00
5.1.50.0070.0409.96
5.1.40.0030.0539.93
5.1.30.0030.02710.38
5.1.20.0000.04010.35
5.1.10.0070.0539.91
5.1.00.0030.0339.96
5.0.50.0030.0278.89
5.0.40.0000.0238.89
5.0.30.0030.0338.89
5.0.20.0030.0178.89
5.0.10.0070.0178.89
5.0.00.0000.0308.89
4.4.90.0030.0378.89
4.4.80.0000.0238.89
4.4.70.0030.0338.89
4.4.60.0100.0308.89
4.4.50.0000.0408.89
4.4.40.0000.0338.89
4.4.30.0030.0308.89
4.4.20.0000.0208.89
4.4.10.0000.0208.89
4.4.00.0000.0478.89
4.3.110.0000.0178.89
4.3.100.0070.0108.89
4.3.90.0000.0178.89
4.3.80.0030.0238.89
4.3.70.0030.0108.89
4.3.60.0000.0208.89
4.3.50.0000.0278.89
4.3.40.0030.0238.89
4.3.30.0030.0138.89
4.3.20.0030.0138.89
4.3.10.0000.0178.89
4.3.00.0000.0138.89

preferences:
60.39 ms | 400 KiB | 5 Q