3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { function getStVar() { static $_stVar; $output = ''; if (!isset($_stVar)) { $_stVar = true; $output = '!'; } else { $output = '.'; } return $output; } } class TestExt_1 extends Test { } class TestExt_2 extends Test { } $t = new Test(); $tt = new Test(); echo $t->getStVar(); echo $tt->getStVar(); echo $t->getStVar(); echo $tt->getStVar(); exit(); $t1 = new TestExt_1(); $t2 = new TestExt_2(); echo $t1->getStVar(); echo $t1->getStVar(); echo $t2->getStVar(); echo $t2->getStVar();
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
!...