<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Assigns a value to a COM component's property</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.com-release.html">com_release</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.variant-abs.html">variant_abs</a></div> <div class="up"><a href="ref.com.html">COM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.com-set" class="refentry"> <div class="refnamediv"> <h1 class="refname">com_set</h1> <p class="verinfo">(PHP 4)</p><p class="refpurpose"><span class="refname">com_set</span> — <span class="dc-title">Assigns a value to a COM component's property</span></p> </div> <div class="refsect1 description" id="refsect1-function.com-set-description"> <h3 class="title">Description</h3> <p class="para"> Deprecated, use the OO syntax instead. </p> <p class="para"> <div class="example" id="example-5362"> <p><strong>Example #1 OO syntax</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// do this<br /></span><span style="color: #0000BB">$obj</span><span style="color: #007700">-></span><span style="color: #0000BB">property </span><span style="color: #007700">= </span><span style="color: #0000BB">$value</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">// instead of this:<br /></span><span style="color: #0000BB">com_set</span><span style="color: #007700">(</span><span style="color: #0000BB">$obj</span><span style="color: #007700">, </span><span style="color: #DD0000">'property'</span><span style="color: #007700">, </span><span style="color: #0000BB">$value</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> <div class="refsect1 notes" id="refsect1-function.com-set-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara"> This function does not exist in PHP 5; instead, you should use the regular and more natural OO syntax to access properties or call methods. </span> </p></blockquote> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.com-release.html">com_release</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.variant-abs.html">variant_abs</a></div> <div class="up"><a href="ref.com.html">COM Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>