3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $bla = ''; public function __construct(){ $this->bla = "fooooo"; } public function __invoke($arg){ $this->bla = $arg + $this->bla; } } Class Foo2 extends Foo { } $blubb = new Foo2(); $blubb("bl0a"); var_dump($blubb);
based on kffRu
Output for 7.1.0 - 7.2.0
Warning: A non-numeric value encountered in /in/7UmPp on line 12 Warning: A non-numeric value encountered in /in/7UmPp on line 12 object(Foo2)#1 (1) { ["bla":protected]=> int(0) }
Output for 5.3.21 - 7.0.20
object(Foo2)#1 (1) { ["bla":protected]=> int(0) }