3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DataCollector { use dataHandler; private static $CollectionData = array(); static function collectedData( $type, $value = NULL ) { if( strtolower( $type ) === 'set' ) { $CollectionData[] = $value; var_dump($CollectionData); } elseif( strtolower( $type ) === 'get' ) return self::$CollectionData; } } trait setData { static function setData( $data ) { DataCollector::collectedData( 'set', $data ); } } trait dataHandler { use setData static function getCollectedData() { DataCollector::collectedData( 'get' ); } } 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)
5.4.170.0000.04018.84
5.4.160.0100.03719.23
5.4.150.0030.04718.82
5.4.140.0100.05016.43
5.4.130.0030.03716.46
5.4.120.0030.03716.35
5.4.110.0070.03316.35
5.4.100.0030.03716.58
5.4.90.0000.04016.72
5.4.80.0030.03316.42
5.4.70.0070.03316.46
5.4.60.0030.03316.39
5.4.50.0000.03716.39
5.4.40.0030.03316.36
5.4.30.0000.03716.40
5.4.20.0000.03716.63
5.4.10.0000.04016.36
5.4.00.0000.04015.84
5.3.270.0000.04014.75
5.3.260.0000.05014.66
5.3.250.0130.03014.61
5.3.240.0030.06714.68
5.3.230.0030.04014.74
5.3.220.0030.03714.60
5.3.210.0030.04014.57
5.3.200.0030.03714.63
5.3.190.0030.04314.59
5.3.180.0070.03314.47
5.3.170.0000.04014.59
5.3.160.0030.04014.45
5.3.150.0200.03314.45
5.3.140.0030.03714.62
5.3.130.0070.03314.61
5.3.120.0000.04314.54
5.3.110.0000.04014.54
5.3.100.0000.04014.19
5.3.90.0030.03713.91
5.3.80.0030.03314.01
5.3.70.0000.03714.04
5.3.60.0030.03314.08
5.3.50.0070.03014.09
5.3.40.0030.03313.96
5.3.30.0030.03313.96
5.3.20.0100.03013.73
5.3.10.0030.04313.65
5.3.00.0030.06013.64

preferences:
134.41 ms | 1398 KiB | 7 Q