3v4l.org

run code in 300+ PHP versions simultaneously
<pre><?php $var1 = 'ccc'; $var2 = 'ccc'; echo "separate variables\n"; debug_zval_dump($var1, $var2); echo "Copying variable just adds references to the same value\n"; $copy = $var1; debug_zval_dump($var1, $copy); echo "Using a reference adds references to the same value \n"; $reference =& $var2; debug_zval_dump($var2, $reference); echo "Using a copy and a reference of the same value actually creates a clone \n"; $reference2 =& $var1; debug_zval_dump($var1, $copy, $reference2);
Output for git.master, rfc.property-hooks
<pre>separate variables string(3) "ccc" interned string(3) "ccc" interned Copying variable just adds references to the same value string(3) "ccc" interned string(3) "ccc" interned Using a reference adds references to the same value string(3) "ccc" interned string(3) "ccc" interned Using a copy and a reference of the same value actually creates a clone string(3) "ccc" interned string(3) "ccc" interned string(3) "ccc" interned
Output for git.master_jit
<pre>separate variables string(3) "ccc" refcount(3) string(3) "ccc" refcount(3) Copying variable just adds references to the same value string(3) "ccc" refcount(5) string(3) "ccc" refcount(5) Using a reference adds references to the same value string(3) "ccc" refcount(4) string(3) "ccc" refcount(4) Using a copy and a reference of the same value actually creates a clone string(3) "ccc" refcount(6) string(3) "ccc" refcount(6) string(3) "ccc" refcount(6)

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