3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function exec(array $context) { $context['bla'] = 'hoi'; } } class B extends A { public function exec(array $context) { parent::exec($context); var_dump($context); } } $b = new B(); $b->exec([]);
based on 8lpMJ
Output for 5.4.2 - 7.2.0
array(0) { }
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/7FluW on line 17
Process exited with code 255.