Skip to content

Enable runnable (WASM) examples for language.functions section#5463

Open
AllenJB wants to merge 1 commit intophp:masterfrom
AllenJB:runnable_lang_func
Open

Enable runnable (WASM) examples for language.functions section#5463
AllenJB wants to merge 1 commit intophp:masterfrom
AllenJB:runnable_lang_func

Conversation

@AllenJB
Copy link
Copy Markdown
Contributor

@AllenJB AllenJB commented Apr 5, 2026

Related: #4799

Comment thread language/functions.xml
echo "Example function.\n";
return $retval;
}
?>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the closing ?> is needless churn. Given how the examples sit within the documentation, I personally also feel that the ?> is a nice “example ends here” indicator.

Copy link
Copy Markdown
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think removing the ?> is worthwhile churn, especially as this is adding kinda unnecessary work for translations.

Comment thread language/functions.xml
Comment on lines +1669 to +1670
<para>
<informalexample>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need a para tag to wrap an example/informalexample tag

Comment thread language/functions.xml
Comment on lines 937 to 953
<![CDATA[
<?php
class Foo
{
static $variable = 'static property';
static function Variable()
{
echo 'Method Variable called';
echo "Method Variable called\n";
}
}

echo Foo::$variable; // This prints 'static property'. It does need a $variable in this scope.
echo Foo::$variable ."\n"; // This prints 'static property'. It does need a $variable in this scope.
$variable = "Variable";
Foo::$variable(); // This calls $foo->Variable() reading $variable in this scope.

?>
]]>
</programlisting>
</example>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this have a screen element and showcase the output?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants