<?php
class 🔥fire {
private $temperature = 5000;
public function __serialize(): array { return ['t' => $this->temperature]; }
public function __unserialize(array $data) { $this->temperature = $data['t']; }
}
class ⭐star extends 🔥fire {
private $size = 695510000;
public function __serialize(): array {
return [
's' => $this->size,
'🔥fire' => parent::__serialize(),
];
}
public function __unserialize(array $data) {
parent::__unserialize( $data['🔥fire'] );
$this->size = $data['s'];
}
}
echo serialize( $test = new ⭐star );