3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Post { protected $fillable = [ 'title', // ... ]; // ... } class Comment { protected $fillable = [ 'title', 'post_id', 'some_other_column', // ... ]; protected $appends = [ 'title' ]; protected $with = [ 'post' ]; public function __construct() { echo 'I should not construct!'; } public function post() : void { // ... } public function getPostAttribute() : ?string { return $this->post->title ?? null; } } var_export((new ReflectionClass(Comment::class))->getDefaultProperties()['fillable']);

preferences:
24.34 ms | 404 KiB | 5 Q