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' ) { DataCollector::$CollectionData[] = $value; var_dump( new DataCollector() ); } elseif( strtolower( $type ) === 'get' ) return DataCollector::$CollectionData; } } class DataCollector { use dataHandler { collectedData as public; } public function __construct() { return $this; } private static $CollectionData = array(); } class Form { use setData {} } class Field extends Form { public function __construct( $type, $text = NULL ) { self::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( 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.01116.38
8.3.50.0110.00816.34
8.3.40.0100.01018.85
8.3.30.0040.01818.69
8.3.20.0040.00418.73
8.3.10.0150.00020.39
8.3.00.0120.00319.25
8.2.180.0130.00316.38
8.2.170.0130.00322.96
8.2.160.0030.01620.35
8.2.150.0040.01124.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0030.00619.13
8.2.110.0070.00321.00
8.2.100.0090.00317.91
8.2.90.0090.00019.51
8.2.80.0040.00419.25
8.2.70.0060.00317.63
8.2.60.0070.00317.80
8.2.50.0000.00818.07
8.2.40.0060.00318.22
8.2.30.0040.00418.03
8.2.20.0040.00417.69
8.2.10.0000.00817.59
8.2.00.0080.00017.62
8.1.280.0070.00725.92
8.1.270.0070.00024.66
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0150.00422.63
8.1.230.0000.01020.89
8.1.220.0040.00417.75
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0030.00617.52
8.1.180.0000.00818.10
8.1.170.0050.00318.84
8.1.160.0050.00318.80
8.1.150.0000.00718.56
8.1.140.0000.00817.45
8.1.130.0050.00317.79
8.1.120.0000.00717.30
8.1.110.0000.00717.52
8.1.100.0030.00317.35
8.1.90.0000.00817.45
8.1.80.0070.00017.37
8.1.70.0030.00317.45
8.1.60.0050.00317.47
8.1.50.0040.00417.50
8.1.40.0040.00417.55
8.1.30.0000.00817.66
8.1.20.0000.00917.55
8.1.10.0000.00817.53
8.1.00.0050.00217.40
8.0.300.0070.00019.90
8.0.290.0000.00816.75
8.0.280.0030.00318.47
8.0.270.0030.00317.20
8.0.260.0050.00316.82
8.0.250.0040.00416.99
8.0.240.0000.00716.87
8.0.230.0040.00416.97
8.0.220.0000.00716.86
8.0.210.0050.00316.91
8.0.200.0000.00716.84
8.0.190.0040.00416.96
8.0.180.0040.00416.86
8.0.170.0050.00316.86
8.0.160.0000.00816.83
8.0.150.0060.00316.76
8.0.140.0070.00316.82
8.0.130.0000.00513.34
8.0.120.0000.00816.89
8.0.110.0000.00716.72
8.0.100.0050.00316.92
8.0.90.0020.00517.00
8.0.80.0140.00016.87
8.0.70.0040.00416.85
8.0.60.0050.00316.96
8.0.50.0040.00416.93
8.0.30.0090.00917.07
8.0.20.0150.00617.12
8.0.10.0050.00316.80
8.0.00.0160.00216.86
7.4.330.0020.00213.02
7.4.320.0000.00916.52
7.4.300.0000.00816.50
7.4.290.0000.00816.59
7.4.280.0030.00516.48
7.4.270.0000.00716.42
7.4.260.0000.00513.20
7.4.250.0030.00616.44
7.4.240.0040.00416.50
7.4.230.0030.00516.70
7.4.220.0160.00316.36
7.4.210.0050.01016.51
7.4.200.0000.00716.62
7.4.190.0000.00716.53
7.4.160.0030.01316.55
7.4.150.0110.00616.64
7.4.140.0170.00316.49
7.4.130.0060.01116.50
7.4.120.0110.00716.50
7.4.110.0000.01816.33
7.4.100.0100.00716.49
7.4.90.0090.00916.57
7.4.80.0150.00619.39
7.4.70.0090.00916.47
7.4.60.0110.00716.42
7.4.50.0000.00916.60
7.4.40.0070.00716.42
7.4.30.0120.00416.20
7.4.00.0070.00014.96
7.3.330.0060.00013.35
7.3.320.0000.00613.11
7.3.310.0000.00716.39
7.3.300.0000.00716.31
7.3.290.0130.00716.30
7.3.280.0100.01016.36
7.3.270.0130.00416.46
7.3.260.0040.01216.37
7.3.250.0120.00916.36
7.3.240.0110.00716.49
7.3.230.0120.00616.38
7.3.210.0130.00316.42
7.3.200.0030.01316.33
7.3.190.0120.00616.27
7.3.180.0060.00916.43
7.3.170.0080.00816.43
7.3.160.0030.01216.55
7.3.120.0060.01014.57
7.3.10.0070.01016.16
7.3.00.0140.00316.29
7.2.330.0150.00316.68
7.2.320.0090.01316.62
7.2.310.0170.00916.62
7.2.300.0090.00916.84
7.2.290.0110.00616.53
7.2.130.0160.01217.02
7.2.120.0110.00716.09
7.2.110.0110.00916.55
7.2.100.0090.01016.74
7.2.90.0160.00316.50
7.2.80.0110.01116.08
7.2.70.0160.01316.73
7.2.60.0140.01417.05
7.2.50.0190.01116.44
7.2.40.0240.01216.55
7.2.30.0110.01116.69
7.2.20.0230.00416.88
7.2.10.0120.00416.52
7.2.00.0090.00618.24
7.1.250.0200.00015.23
7.1.100.0060.00618.19
7.1.70.0030.01017.10
7.1.60.0130.00619.40
7.1.50.0210.01134.76
7.1.00.0000.07722.36
7.0.200.0000.00816.52
7.0.140.0000.07722.10
7.0.120.0030.07322.05
7.0.60.0030.04719.92
7.0.50.0100.05017.89
7.0.40.0030.09020.13
7.0.30.0330.07320.26
7.0.20.0300.07720.07
7.0.10.0200.03720.34
7.0.00.0030.05720.35
5.6.280.0000.07320.93
5.6.210.0070.05320.75
5.6.200.0030.04018.24
5.6.190.0130.07320.33
5.6.180.0230.04020.38
5.6.170.0270.07720.45
5.6.160.0100.08020.61
5.6.150.0130.03318.34
5.6.140.0070.06018.18
5.6.130.0100.07018.18
5.6.120.0000.08721.06
5.6.110.0130.07321.04
5.6.100.0030.08021.18
5.6.90.0070.07021.02
5.6.80.0030.04020.55
5.6.70.0200.06720.39
5.5.350.0270.04720.32
5.5.340.0100.08018.07
5.5.330.0070.08020.33
5.5.320.0000.08320.44
5.5.310.0270.04720.34
5.5.300.0100.07017.97
5.5.290.0100.03717.97
5.5.280.0100.04020.86
5.5.270.0000.04720.86
5.5.260.0100.07320.97
5.5.250.0130.05320.60
5.5.240.0130.08020.29
5.4.450.0000.04319.41
5.4.440.0230.02719.47
5.4.430.0100.03719.40
5.4.420.0030.08019.57
5.4.410.0070.03719.45
5.4.400.0100.04718.93
5.4.390.0000.05718.87
5.4.380.0000.07718.87
5.4.370.0100.06019.01
5.4.360.0070.04019.09
5.4.350.0070.03719.12
5.4.340.0030.04018.99
5.4.320.0070.06319.16
5.4.310.0170.06718.85
5.4.300.0070.06019.17
5.4.290.0170.06319.24
5.4.280.0100.03319.11
5.4.270.0030.06018.84
5.4.260.0070.03718.84
5.4.250.0070.04019.24
5.4.240.0070.04718.86
5.4.230.0100.03718.84
5.4.220.0130.06719.16
5.4.210.0000.05018.84
5.4.200.0070.03718.84
5.4.190.0030.04019.13
5.4.180.0070.03318.84
5.4.170.0070.07018.92
5.4.160.0070.08319.27
5.4.150.0070.06318.98
5.4.140.0030.07316.59
5.4.130.0000.07316.30
5.4.120.0030.06316.59
5.4.110.0000.04016.57
5.4.100.0030.04016.48
5.4.90.0030.05716.51
5.4.80.0000.07016.41
5.4.70.0030.06716.43
5.4.60.0070.07016.29
5.4.50.0100.06316.27
5.4.40.0070.03716.27
5.4.30.0030.03316.34
5.4.20.0100.06716.39
5.4.10.0070.07316.38
5.4.00.0000.07015.84
5.3.290.0070.06314.48
5.3.280.0070.03714.68
5.3.270.0000.07014.54
5.3.260.0070.03714.55
5.3.250.0030.03714.43
5.3.240.0000.04314.48
5.3.230.0030.07014.55
5.3.220.0070.04314.58
5.3.210.0030.04014.51
5.3.200.0100.03014.49
5.3.190.0030.06014.49
5.3.180.0000.04314.65
5.3.170.0100.06714.52
5.3.160.0000.05314.36
5.3.150.0070.04014.50
5.3.140.0100.07014.48
5.3.130.0030.03714.49
5.3.120.0000.04014.51
5.3.110.0070.07314.48
5.3.100.0130.06013.98
5.3.90.0130.03013.97
5.3.80.0030.05713.96
5.3.70.0000.04713.85
5.3.60.0000.04013.82
5.3.50.0070.03313.92
5.3.40.0030.06013.86
5.3.30.0100.06313.71
5.3.20.0170.06013.64
5.3.10.0000.07713.58
5.3.00.0030.04013.65
5.2.170.0030.05011.08
5.2.160.0030.06311.30
5.2.150.0000.05011.03
5.2.140.0030.06011.01
5.2.130.0030.06311.01
5.2.120.0100.04311.25
5.2.110.0070.04711.08
5.2.100.0070.05711.09
5.2.90.0070.05311.09
5.2.80.0030.05711.01
5.2.70.0000.06711.01
5.2.60.0000.03311.01
5.2.50.0000.03011.01
5.2.40.0030.04011.01
5.2.30.0070.03311.01
5.2.20.0030.04311.01
5.2.10.0030.04711.01
5.2.00.0070.02711.01
5.1.60.0000.04011.01
5.1.50.0100.02011.01
5.1.40.0030.02311.01
5.1.30.0030.05711.01
5.1.20.0030.04711.01
5.1.10.0030.03311.01
5.1.00.0130.04711.01
5.0.50.0030.02711.01
5.0.40.0030.02011.01
5.0.30.0000.05711.01
5.0.20.0030.02011.01
5.0.10.0030.02311.01
5.0.00.0030.03011.01
4.4.90.0000.02311.01
4.4.80.0030.01311.01
4.4.70.0030.03711.01
4.4.60.0000.03311.01
4.4.50.0030.02011.01
4.4.40.0030.04711.01
4.4.30.0000.03311.01
4.4.20.0000.03011.01
4.4.10.0000.03311.01
4.4.00.0030.05011.01
4.3.110.0000.03711.01
4.3.100.0000.02011.01
4.3.90.0070.03311.01
4.3.80.0000.06011.01
4.3.70.0000.02311.01
4.3.60.0030.02311.01
4.3.50.0000.02311.01
4.3.40.0030.04011.01
4.3.30.0000.03711.01
4.3.20.0000.02311.01
4.3.10.0000.03011.01
4.3.00.0000.03311.01

preferences:
54.99 ms | 400 KiB | 5 Q