3v4l.org

run code in 300+ PHP versions simultaneously
<?php static class StackTest extends PHPUnit_Framework_TestCase { public function testPushAndPop() { $stack = array(); $this->assertEquals(0, count($stack)); array_push($stack, 'foo'); $this->assertEquals('foo', $stack[count($stack)-1]); $this->assertEquals(1, count($stack)); $this->assertEquals('foo', array_pop($stack)); $this->assertEquals(0, count($stack)); } } StackTest.testPushAndPop(); ?>
Output for 5.4.0 - 5.4.15
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting :: (T_PAAMAYIM_NEKUDOTAYIM) in Spns8 on line 3
Process exited with code 255.
Output for 5.3.25
Parse error: syntax error, unexpected T_CLASS, expecting T_PAAMAYIM_NEKUDOTAYIM in /in/sZ3ru on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Parse error: syntax error, unexpected T_CLASS, expecting T_PAAMAYIM_NEKUDOTAYIM in Spns8 on line 3
Process exited with code 255.

preferences:
177.99 ms | 1395 KiB | 49 Q