3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Man { protected $Vik; protected $Staty; function input($v, $s) { $this-> Vik=$v; $this->Staty=$s; } } class Gayduk extends Man { var $Name; var $Priz; function input1($n, $p) { $this->Name=$n; $this->Priz=$p; } function printinfo() { echo "$this->$Vik"; echo "$this->$Staty"; echo "$this->Name"; echo "$this->Priz"; } } $man = new Man(); $rsg = new Gayduk(); $man->input('18', 'Чоловіча'); $rsg->input1('Роман', 'Гайдук'); $rsg->printinfo(); ?>
based on DRdfl
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class Gayduk could not be converted to string in /in/0GNeW on line 23
Process exited with code 255.
Output for 5.4.0 - 5.6.30, hhvm-3.10.1, 7.0.0 - 7.0.20
Catchable fatal error: Object of class Gayduk could not be converted to string in /in/0GNeW on line 23
Process exited with code 255.
Output for hhvm-3.11.1, hhvm-3.13.2 - 3.17.3
Fatal error: Uncaught Error: Object of class Gayduk could not be converted to string in /in/0GNeW:23 Stack trace: #0 /in/0GNeW(35): Gayduk->printinfo() #1 {main}
Process exited with code 255.
Output for hhvm-3.12.14

Process exited with code 137.