Jump to content

Runtime evaluation: Difference between revisions

PHP example (viva la reddit)
(PHP example (viva la reddit))
Line 251:
'''
10</lang>
=={{header|PHP}}==
 
The [http://www.php.net/eval eval construct] allow string evaluation as PHP code. Opening and closing tags are not required. Return statements immediatly terminates evaluation . Eval returns NULL, unless return is called in evalued code.
<lang php>
<?php
$code = 'echo "hello world"';
eval($code);
$code = 'return "hello world"';
print eval($code);
</lang>
=={{header|Ruby}}==
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.