PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php class StateQueueMessage implements JsonSerializable { private String $name; private String $face; public function __construct($name, $face) { $this->name = $name; $this->face = $face; } public function jsonSerialize() : array { return [ 'name' => $this->name, 'face' => $this->face, 'class' => get_class($this) ]; } public function __toString() { return json_encode($this); } } $herpaderp = new StateQueueMessage('steve', 'bigface'); echo $herpaderp;
Show:  
Copy Clear