3v4l.org

run code in 300+ PHP versions simultaneously
<?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(); ?>
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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} thrown in /in/0GNeW on line 23
Process exited with code 255.
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
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.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.30, 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.

preferences:
245.45 ms | 402 KiB | 302 Q