3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.1.0
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/EVSIv on line 11 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
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2
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
Output for 5.1.3 - 5.2.17
Parse error: syntax error, unexpected T_SL in /in/EVSIv on line 26
Process exited with code 255.
Output for 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/EVSIv on line 14 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/EVSIv on line 15 Parse error: syntax error, unexpected T_SL in /in/EVSIv on line 27
Process exited with code 255.
Output for 5.1.0 - 5.1.1
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/EVSIv on line 13 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/EVSIv on line 14 Parse error: syntax error, unexpected T_SL in /in/EVSIv on line 26
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/EVSIv on line 13 Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/EVSIv on line 14 Parse error: parse error, unexpected T_SL in /in/EVSIv on line 26
Process exited with code 255.
Output for 4.4.3 - 4.4.9
Parse error: syntax error, unexpected T_SL, expecting ',' or ';' in /in/EVSIv on line 26
Process exited with code 255.
Output for 4.4.2
Parse error: syntax error, unexpected T_SL, expecting ',' or ';' in /in/EVSIv on line 27
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_SL, expecting ',' or ';' in /in/EVSIv on line 26
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/EVSIv on line 26
Process exited with code 255.