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']);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'title', 1 => 'post_id', 2 => 'some_other_column', )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
109.79 ms | 405 KiB | 5 Q