3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Builder { /** @Column(type="string") */ protected $id; /** @Column(type="string") */ protected $name; /** @ManyToOne(targetEntity="User") * @JoinColumn(name="created_by", referencedColumnName="id") */ protected $created_by; /** @ManyToOne(targetEntity="User") * @JoinColumn(name="updated_by", referencedColumnName="id") */ protected $updated_by; public function __construct(array $input) { $this->id = $input['id']; $this->name = $input['name']; $this->created_by = $input['created_by']; $this->updated_by = $input['updated_by']; } } class User { /** @Column(type="string") */ protected $id; /** @Column(type="string") */ protected $name; public function __construct(array $input) { $this->id = $input['id']; $this->name = $input['name']; } } $input = []; $input['id'] = 1; $input['name'] = 'TEST'; $input['created_by'] = new User(['id' => 1, 'name' => 'User']); $input['updated_by'] = new User(['id' => 1, 'name' => 'User']); $builder = new Builder($input); print_r($builder);
Output for git.master, git.master_jit, rfc.property-hooks
Builder Object ( [id:protected] => 1 [name:protected] => TEST [created_by:protected] => User Object ( [id:protected] => 1 [name:protected] => User ) [updated_by:protected] => User Object ( [id:protected] => 1 [name:protected] => User ) )

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:
60.13 ms | 402 KiB | 8 Q