3v4l.org

run code in 300+ PHP versions simultaneously
<?php class thisClass { public $files = array('a č o.png','a č o.png','a č o.png'); } $foo = new thisClass(); define('URL', '127.0.0.1/'); foreach($foo->files as $key => $value){ echo '<a href="' . URL . 'file/show/' . rawurlencode($foo->$files[$key]) . '" target="_blank"> Show file </a>' . "\n"; //gives link leading to: 127.0.0.1/file%2Fshow%2Fa č o.png $address = rawurlencode($filename); echo '<a href="' . URL . 'file/show/' . $foo->$files[$key] . '" target="_blank"> Show file </a>'; //gives link leading to: 127.0.0.1/file/show/a č o.png } ?>
Output for 8.3.0 - 8.3.4
Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on null in /in/b6XtN on line 8 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on null in /in/b6XtN on line 8 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on null in /in/b6XtN on line 8 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a>
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17
Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 8 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 8 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 8 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Deprecated: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a>
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $files in /in/b6XtN on line 8 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 8 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Warning: Undefined variable $filename in /in/b6XtN on line 11 Warning: Undefined variable $files in /in/b6XtN on line 12 Warning: Undefined property: thisClass::$ in /in/b6XtN on line 12 Warning: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a>
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: files in /in/b6XtN on line 8 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 8 Notice: Trying to access array offset on value of type null in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: filename in /in/b6XtN on line 11 Notice: Undefined variable: files in /in/b6XtN on line 12 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 12 Notice: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: files in /in/b6XtN on line 8 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 8 Notice: Trying to access array offset on value of type null in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: filename in /in/b6XtN on line 11 Notice: Undefined variable: files in /in/b6XtN on line 12 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 12 Notice: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: files in /in/b6XtN on line 8 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 8 Notice: Trying to access array offset on value of type null in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: filename in /in/b6XtN on line 11 Notice: Undefined variable: files in /in/b6XtN on line 12 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 12 Notice: Trying to access array offset on value of type null in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a>
Output for 7.3.32 - 7.3.33
<a href="127.0.0.1/file/show/" target="_blank"> Show file </a> <a href="127.0.0.1/file/show/" target="_blank"> Show file </a><a href="127.0.0.1/file/show/" target="_blank"> Show file </a> <a href="127.0.0.1/file/show/" target="_blank"> Show file </a><a href="127.0.0.1/file/show/" target="_blank"> Show file </a> <a href="127.0.0.1/file/show/" target="_blank"> Show file </a>
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
Notice: Undefined variable: files in /in/b6XtN on line 8 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: filename in /in/b6XtN on line 11 Notice: Undefined variable: files in /in/b6XtN on line 12 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: files in /in/b6XtN on line 8 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: filename in /in/b6XtN on line 11 Notice: Undefined variable: files in /in/b6XtN on line 12 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: files in /in/b6XtN on line 8 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 8 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a> Notice: Undefined variable: filename in /in/b6XtN on line 11 Notice: Undefined variable: files in /in/b6XtN on line 12 Notice: Undefined property: thisClass::$ in /in/b6XtN on line 12 <a href="127.0.0.1/file/show/" target="_blank"> Show file </a>
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: files in /in/b6XtN on line 8 Fatal error: Uncaught Error: Cannot access empty property in /in/b6XtN:8 Stack trace: #0 {main} thrown in /in/b6XtN on line 8
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Notice: Undefined variable: files in /in/b6XtN on line 8 Fatal error: Cannot access empty property in /in/b6XtN on line 8
Process exited with code 255.

preferences:
228.66 ms | 401 KiB | 222 Q