3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*{ "_id" : ObjectId("595baefce2810a6a8a94fe2d"), "user" : "1234abc", "type" : "session-started", "name" : "moja o sesja", "reference_id" : "hippo-123", "created_on" : ISODate("2017-01-01T01:01:01.123Z") }*/ class A { private static $_id = 0x10a6a8a94fe2d; private $user; private $type; private $reference_id; private $created_on; public function __construct($user, $type, $reference_id, $created_on) { $this->user = $user; $this->type = $type; $this->reference_id = $reference_id; $this->created_on = $created_on; } public function __toString() { return sprintf('{ "_id": ObjectId("595baefce28%x"), "user": "%s", "type": "%s", "name": "my %s", "reference_id": "hippo-%s", "created_on": ISODate("%s.000Z") }', ++self::$_id, $this->user, $this->type, $this->type, $this->reference_id, $this->created_on ); } } echo new A('u1', 'session_started', 11, '2017-01-01T01:01:01');
Output for git.master, git.master_jit, rfc.property-hooks
{ "_id": ObjectId("595baefce2810a6a8a94fe2e"), "user": "u1", "type": "session_started", "name": "my session_started", "reference_id": "hippo-11", "created_on": ISODate("2017-01-01T01:01:01.000Z") }

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:
33.13 ms | 401 KiB | 8 Q