3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function __construct() { $this->a = "hello"; $this->b = "hi"; $this->val = "howdy"; $val = "a"; echo $this->{$val}; // outputs "hello" echo "\n"; $val = "b"; echo $this->{$val}; // outputs "hi" echo "\n"; echo $this->val; //outputs "howdy" echo "\n"; echo $this->{"val"}; setConfigParam('aVariableName', array('one', 'two', 'three')); echo->$aVariableName; } public function setConfigParam( $sName, $sValue ) { if ( isset( $this->$sName ) ) { $this->$sName = $sValue; } else { $this->_aConfigParams[$sName] = $sValue; } } } $foo = new foo();

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.290.0120.03512.50
5.4.280.0120.03312.39
5.4.270.0100.04812.39
5.4.260.0080.05612.39
5.4.250.0140.04812.39
5.4.240.0070.05212.39
5.4.230.0100.05112.39
5.4.220.0210.04712.39
5.4.210.0070.03512.38
5.4.200.0080.04512.39
5.4.190.0090.04612.38
5.4.180.0120.04712.38
5.4.170.0130.04912.39
5.4.160.0110.03512.38
5.4.150.0150.04912.38
5.4.140.0070.05112.07
5.4.130.0080.03512.05
5.4.120.0100.04112.02
5.4.110.0090.03612.02
5.4.100.0120.04012.02
5.4.90.0120.05312.01
5.4.80.0120.03712.02
5.4.70.0100.03512.01
5.4.60.0140.03612.01
5.4.50.0120.04812.01
5.4.40.0110.03212.00
5.4.30.0060.03712.00
5.4.20.0090.03411.99
5.4.10.0080.03511.99
5.4.00.0040.04511.48
5.3.280.0090.04312.71
5.3.270.0100.05112.72
5.3.260.0050.04612.72
5.3.250.0080.03712.71
5.3.240.0120.03412.72
5.3.230.0100.03712.71
5.3.220.0110.03512.68
5.3.210.0090.04212.68
5.3.200.0070.05012.68
5.3.190.0130.03812.68
5.3.180.0110.04012.67
5.3.170.0090.04812.67
5.3.160.0060.04712.67
5.3.150.0090.03812.67
5.3.140.0100.03312.66
5.3.130.0130.05312.66
5.3.120.0100.03812.66
5.3.110.0080.04012.66
5.3.100.0100.03412.13
5.3.90.0090.04012.11
5.3.80.0080.04712.09
5.3.70.0070.03912.10
5.3.60.0060.04012.09
5.3.50.0090.03912.03
5.3.40.0100.03912.04
5.3.30.0060.04111.99
5.3.20.0100.03711.77
5.3.10.0120.04711.73
5.3.00.0070.03911.72

preferences:
135.59 ms | 1394 KiB | 7 Q