3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { private $fname; private $lname; // Constructor same class name here public function __construct($fname, $lname) { $this->fname = $fname; $this->lname = $lname; } // public method to show name public function showName() { echo "My name is: " . $this->fname . " " . $this->lname . "<br/>"; } } // creating class object $john = new Person("John", "Wick"); $john->showName();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
218.81 ms | 3323 KiB | 8 Q