3v4l.org

run code in 300+ PHP versions simultaneously
<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()"><span class="google-src-text" style="direction: ltr; text-align: left"><?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"}; } } $foo = new foo();</span> <? Php class foo {function __ construct () {$ this-> a = "bonjour"; $ this-> b = "salut"; $ this-> val = "allo"; $ val = "a"; echo $ this-> {$ val}; / / affiche "bonjour" echo "\ n"; $ val = "b"; echo $ this-> {$ val}; / / affiche "salut" echo "\ n"; echo $ this-> val; / / affiche "Howdy" echo "\ n"; echo $ this-> {"val"};}} $ foo = new foo ();</span>

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.0160.04412.38
5.4.160.0100.04912.38
5.4.150.0260.06412.37
5.4.140.0190.05512.06
5.4.130.0150.04312.04
5.4.120.0160.04212.01
5.4.110.0200.03812.00
5.4.100.0180.04112.00
5.4.90.0210.06712.00
5.4.80.0170.03912.00
5.4.70.0160.04112.00
5.4.60.0160.05712.00
5.4.50.0150.04212.00
5.4.40.0160.04011.99
5.4.30.0120.04511.98
5.4.20.0190.05211.98
5.4.10.0180.03811.99
5.4.00.0150.04011.48
5.3.270.0150.04712.73
5.3.260.0180.04612.72
5.3.250.0220.05612.72
5.3.240.0230.05412.72
5.3.230.0180.04512.71
5.3.220.0180.04212.68
5.3.210.0180.04312.68
5.3.200.0210.05312.68
5.3.190.0280.05012.68
5.3.180.0190.04312.67
5.3.170.0170.04512.67
5.3.160.0140.04712.67
5.3.150.0270.06412.67
5.3.140.0160.04512.66
5.3.130.0160.04612.66
5.3.120.0200.04312.66
5.3.110.0240.05612.66
5.3.100.0140.05012.12
5.3.90.0250.06512.10
5.3.80.0170.05912.09
5.3.70.0190.04112.09
5.3.60.0120.04812.07
5.3.50.0120.04612.01
5.3.40.0190.05612.01
5.3.30.0160.04111.98
5.3.20.0180.07011.76
5.3.10.0160.04011.73
5.3.00.0140.04311.70

preferences:
144.25 ms | 1398 KiB | 7 Q