<?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 "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should print a capital 'A': \x41
EOT;
?>
Warning: Trying to access array offset on null in /in/g96BI on line 28
My name is "MyName". I am printing some .
Now, I am printing some .
This should print a capital 'A': A
Warning: Trying to access array offset on value of type null in /in/g96BI on line 28
My name is "MyName". I am printing some .
Now, I am printing some .
This should print a capital 'A': A
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in /in/g96BI on line 11
My name is "MyName". I am printing some Foo.
Now, I am printing some Bar2.
This should print a capital 'A': A
My name is "MyName". I am printing some Foo.
Now, I am printing some Bar2.
This should print a capital 'A': A
Output for 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/g96BI on line 14
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/g96BI on line 15
My name is "MyName". I am printing some Foo.
Now, I am printing some Bar2.
This should print a capital 'A': A
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/g96BI on line 13
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/g96BI on line 14
My name is "MyName". I am printing some Foo.
Now, I am printing some Bar2.
This should print a capital 'A': A