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> EOT; $foobar = <<<EOT <foo>bar</foo> EOT; $bazbar = <<<EOT <bar>my foobar</bar> EOT; EOT; echo $output; echo $foobar;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
<?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> Fatal error: Uncaught Error: Undefined constant "EOT" in /in/q2EHI:42 Stack trace: #0 {main} thrown in /in/q2EHI on line 42
Process exited with code 255.
Output for 7.3.16 - 7.3.33, 7.4.0 - 7.4.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> Warning: Use of undefined constant EOT - assumed 'EOT' (this will throw an Error in a future version of PHP) in /in/q2EHI on line 42 <?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><foo>bar</foo>
Output for 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: bazbar in /in/q2EHI on line 38 Warning: Use of undefined constant EOT - assumed 'EOT' (this will throw an Error in a future version of PHP) in /in/q2EHI on line 42 <?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> <foo>bar</foo> EOT; = <<<EOT <bar>my foobar</bar>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
<?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: bazbar in /in/q2EHI on line 38 Notice: Use of undefined constant EOT - assumed 'EOT' in /in/q2EHI on line 42 <?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> <foo>bar</foo> EOT; = <<<EOT <bar>my foobar</bar>
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: bazbar in /in/q2EHI on line 39 Notice: Use of undefined constant EOT - assumed 'EOT' in /in/q2EHI on line 42 <?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> <foo>bar</foo> EOT; = <<<EOT <bar>my foobar</bar>

preferences:
174.39 ms | 405 KiB | 185 Q