3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait DataCollector { static function setData( $data ) { DataCollector::collectedData( 'set', $data ); } private static function collectedData( $type, $value = NULL ) { static $CollectionData = array(); if( strtolower( $type ) === 'set' ) { $CollectionData[] = $value; var_dump($CollectionData); } elseif( strtolower( $type ) === 'get' ) var_dump($CollectionData); } private static function getCollectedData() { DataCollector::collectedData( 'get' ); } } class dataHandler { use DataCollector { getCollectedData as public } } class Form { use DataCollector {} } class Field extends Form { public function __construct( $type, $text = NULL ) { DataCollector::setData( $type ); } } class A { use DataCollector{} public function __construct( $type, $text = NULL ) { DataCollector::setData( $type ); } } $Field1 = new Field( '1' ); $Field2 = new Field( '2' ); $A = new A( '3' ); DataCollector::setData('4'); dataHandler::setData('5'); 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.0080.04712.41
5.4.160.0100.04612.40
5.4.150.0140.05212.39
5.4.140.0100.04612.08
5.4.130.0120.04712.07
5.4.120.0080.05812.03
5.4.110.0100.04712.03
5.4.100.0100.03812.02
5.4.90.0100.04112.03
5.4.80.0110.04712.03
5.4.70.0110.05112.02
5.4.60.0170.05712.02
5.4.50.0110.04312.02
5.4.40.0100.04812.01
5.4.30.0100.04612.01
5.4.20.0110.05212.00
5.4.10.0170.06012.01
5.4.00.0090.04611.50
5.3.270.0110.04512.72
5.3.260.0090.04612.72
5.3.250.0090.04512.72
5.3.240.0110.04812.72
5.3.230.0120.04412.71
5.3.220.0130.04612.68
5.3.210.0130.06112.68
5.3.200.0140.05912.68
5.3.190.0110.05112.68
5.3.180.0130.04212.67
5.3.170.0160.05212.67
5.3.160.0100.04312.67
5.3.150.0100.04412.67
5.3.140.0140.06112.66
5.3.130.0150.06412.66
5.3.120.0110.05112.66
5.3.110.0110.04612.66
5.3.100.0100.04712.12
5.3.90.0110.04612.08
5.3.80.0120.05212.08
5.3.70.0090.04412.08
5.3.60.0110.04312.07
5.3.50.0110.04312.00
5.3.40.0140.03912.00
5.3.30.0110.04111.95
5.3.20.0110.04311.73
5.3.10.0090.04211.69
5.3.00.0150.04811.67

preferences:
143.5 ms | 1394 KiB | 7 Q