3v4l.org

run code in 300+ PHP versions simultaneously
<?php $output = <<<EOT <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" Yadda yadda yadda <dict> <key>default</key> EOT; $output .= "<string>" . "Hello" . "</string>"; $output .= <<<EOT </dict> <key>anchorLeft</key> <string>1</string> <key>anchorRight</key> EOT; echo $output; $output = <<<EOT <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" Yadda yadda yadda <dict> <key>default</key> EOT; $output .= "<string>" . "Hello" . "</string>"; $output .= <<<EOT </dict> <key>anchorLeft</key> <string>1</string> <key>anchorRight</key> \nEOT; $foobar = <<<EOT <foo>bar</foo> EOT; echo \n echo EOT; EOT; echo $output; echo $foobar;
Output for 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Parse error: Invalid body indentation level (expecting an indentation level of at least 16) in /in/VhVKd on line 34
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Parse error: Invalid body indentation level (expecting an indentation level of at least 16) in /in/VhVKd on line 34
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" Yadda yadda yadda <dict> <key>default</key> <string>Hello</string> </dict> <key>anchorLeft</key> <string>1</string> <key>anchorRight</key> Notice: Undefined variable: foobar in /in/VhVKd on line 34 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" Yadda yadda yadda <dict> <key>default</key> <string>Hello</string> </dict> <key>anchorLeft</key> <string>1</string> <key>anchorRight</key> EOT; = <<<EOT <foo>bar</foo> EOT; echo echo EOT; Notice: Undefined variable: foobar in /in/VhVKd on line 41
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" Yadda yadda yadda <dict> <key>default</key> <string>Hello</string> </dict> <key>anchorLeft</key> <string>1</string> <key>anchorRight</key> Notice: Undefined variable: foobar in /in/VhVKd on line 38 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" Yadda yadda yadda <dict> <key>default</key> <string>Hello</string> </dict> <key>anchorLeft</key> <string>1</string> <key>anchorRight</key> EOT; = <<<EOT <foo>bar</foo> EOT; echo echo EOT; Notice: Undefined variable: foobar in /in/VhVKd on line 41

preferences:
141.47 ms | 404 KiB | 183 Q