3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { public function __construct($v) { $this->v = $v; } public function __toString() { return 'a'; } } $list = array(new T(1), new T(2)); usort($list, function($a, $b) { return strcmp($a, $b); }); // PHP has 2, then 1 // HHVM has 1, then 2 print_r($list);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property T::$v is deprecated in /in/EIRKJ on line 6 Deprecated: Creation of dynamic property T::$v is deprecated in /in/EIRKJ on line 6 Array ( [0] => T Object ( [v] => 1 ) [1] => T Object ( [v] => 2 ) )

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