3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class TestCommand { public function __construct( private string $name, public bool $isDeveloper, public int $age, public int $id, ) {} } /* $testCommand = new TestCommand('John', 25, true); var_dump($testCommand); echo serialize($testCommand); */ $serializedClass = 'O:11:"TestCommand":3:{s:4:"name";s:4:"John";s:3:"age";i:25;s:11:"isDeveloper";b:1;}'; $testCommand = unserialize($serializedClass); var_dump($testCommand);

preferences:
28.8 ms | 405 KiB | 5 Q