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 ai9mg
Output for 7.0.0 - 7.2.0
Warning: Declaration of B::exec(array $context) should be compatible with A::exec(array &$context) in /in/XXmqE on line 14 array(1) { ["bla"]=> string(3) "hoi" }
Output for 5.4.2 - 5.6.28
Strict Standards: Declaration of B::exec() should be compatible with A::exec(array &$context) in /in/XXmqE on line 14 array(1) { ["bla"]=> string(3) "hoi" }
Output for 5.3.18 - 5.3.29
Strict Standards: Declaration of B::exec() should be compatible with that of A::exec() in /in/XXmqE on line 14 Parse error: syntax error, unexpected '[', expecting ')' in /in/XXmqE on line 17
Process exited with code 255.