3v4l.org

run code in 200+ PHP versions simultaneously
<?php $o= new stdclass; $o->a= 'b'; $o->b= 'c'; $o2= $o; $o2->a= 'd'; var_dump($o); var_dump($o2); $o2->b = 'foo'; var_dump($o); var_dump($o2); $o3= clone $o; $o3->a= 'e'; var_dump($o); var_dump($o3);

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(1) "c" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(1) "c" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#2 (2) { ["a"]=> string(1) "e" ["b"]=> string(3) "foo" }
Output for branch php-master+opcache
object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(1) "c" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(1) "c" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#2 (2) { ["a"]=> string(1) "e" ["b"]=> string(3) "foo" }
Output for branch php-master+jit
object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(1) "c" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(1) "c" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#1 (2) { ["a"]=> string(1) "d" ["b"]=> string(3) "foo" } object(stdClass)#2 (2) { ["a"]=> string(1) "e" ["b"]=> string(3) "foo" }

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