3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait DataCollector { private $collectionData; final private function setData( $data ) { $this->CollectionData[] = $data; return $this; } public function getCollectedData() { return $this->CollectionData; } } class Field { use DataCollector; public function __construct( $type, $text = NULL ) { $this->setData( $type )->setData( $text ); } } $1 = new Field( 'text' ); $1->getCollectedData(); $2 = new Field; $2->getCollectedData( 'html', 'hello' );

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)
5.4.170.0130.05319.14
5.4.160.0100.06319.13
5.4.150.0100.05718.84
5.4.140.0130.06316.32
5.4.130.0070.03316.43
5.4.120.0070.03716.46
5.4.110.0070.03316.32
5.4.100.0030.08016.50
5.4.90.0100.06716.35
5.4.80.0070.06316.33
5.4.70.0230.05016.71
5.4.60.0130.04016.35
5.4.50.0170.06316.40
5.4.40.0070.06716.38
5.4.30.0030.03716.38
5.4.20.0030.03716.27
5.4.10.0070.05016.43
5.4.00.0030.05015.99
5.3.270.0100.07314.50
5.3.260.0030.06014.56
5.3.250.0070.03714.53
5.3.240.0100.08014.59
5.3.230.0070.05014.50
5.3.220.0070.07314.51
5.3.210.0130.06314.50
5.3.200.0000.04014.58
5.3.190.0070.04714.51
5.3.180.0070.08014.39
5.3.170.0070.04714.50
5.3.160.0070.03314.52
5.3.150.0130.06714.35
5.3.140.0030.05014.48
5.3.130.0100.07014.48
5.3.120.0070.04314.49
5.3.110.0070.03714.47
5.3.100.0030.03714.05
5.3.90.0000.04014.00
5.3.80.0070.03313.96
5.3.70.0030.04013.95
5.3.60.0100.04314.03
5.3.50.0070.07313.88
5.3.40.0100.07313.89
5.3.30.0070.05313.84
5.3.20.0100.06313.62
5.3.10.0070.04013.74
5.3.00.0070.03313.56

preferences:
138.11 ms | 1394 KiB | 7 Q