3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<EOD Example of string spanning multiple lines using heredoc syntax. EOD; /* More complex example, with variables. */ class foo { var $foo; var $bar; function foo() { $this->foo = 'Foo'; $this->bar = array('Bar1', 'Bar2', 'Bar3'); } } $foo = new foo(); $name = 'MyName'; echo <<<EOT My name is "$str". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should print a capital 'A': \x41 EOT; ?>
Output for git.master, git.master_jit
Warning: Trying to access array offset on value of type null in /in/igcV5 on line 28 My name is "Example of string spanning multiple lines using heredoc syntax.". I am printing some . Now, I am printing some . This should print a capital 'A': A
Output for rfc.property-hooks
Warning: Trying to access array offset on null in /in/igcV5 on line 28 My name is "Example of string spanning multiple lines using heredoc syntax.". I am printing some . Now, I am printing some . This should print a capital 'A': A

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:
38.4 ms | 401 KiB | 8 Q