3v4l.org

run code in 300+ PHP versions simultaneously
<?php function the_title() { return 'A Title';} function the_permalink() { return 'https://google.com';} function has_post_thumbnail() { return true;} function the_post_thumbnail($whateverThisIs) { return '<img src="https://upload.wikimedia.org/wikipedia/en/2/22/Charlie_Brown.png" />'; } function get_post_custom_values() { $key = 'Gal_IMG'; $value = 'https://en.wikipedia.org/wiki/Main_Page#/media/File:BepiColombo_spacecraft_model.png'; } $imgClass = 'no-img'; $img = ''; $title = the_title(); $link = the_permalink(); // $BG_Img = 'background-image:url('+ $value +');display:block;'; // if(has_post_thumbnail()) { $imgClass = ''; $img = the_post_thumbnail('alm-thumbnail'); } echo " <li class='${imgClass}'> ${img} <h3> <a href='${link}' style='${BG_Img}'>${title} </a> </h3> </li> ";
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/NF0Hm on line 26 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/NF0Hm on line 27 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/NF0Hm on line 28 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/NF0Hm on line 30 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/NF0Hm on line 30 Warning: Undefined variable $value in /in/NF0Hm on line 18 Fatal error: Uncaught TypeError: Unsupported operand types: string + null in /in/NF0Hm:18 Stack trace: #0 {main} thrown in /in/NF0Hm on line 18
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27
Warning: Undefined variable $value in /in/NF0Hm on line 18 Fatal error: Uncaught TypeError: Unsupported operand types: string + null in /in/NF0Hm:18 Stack trace: #0 {main} thrown in /in/NF0Hm on line 18
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: value in /in/NF0Hm on line 18 Warning: A non-numeric value encountered in /in/NF0Hm on line 18 Warning: A non-numeric value encountered in /in/NF0Hm on line 18 <li class=''> <img src="https://upload.wikimedia.org/wikipedia/en/2/22/Charlie_Brown.png" /> <h3> <a href='https://google.com' style='0'>A Title </a> </h3> </li>
Output for 7.3.32 - 7.3.33
Warning: A non-numeric value encountered in /in/NF0Hm on line 18 Warning: A non-numeric value encountered in /in/NF0Hm on line 18 <li class=''> <img src="https://upload.wikimedia.org/wikipedia/en/2/22/Charlie_Brown.png" /> <h3> <a href='https://google.com' style='0'>A Title </a> </h3> </li>
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33
Notice: Undefined variable: value in /in/NF0Hm on line 18 <li class=''> <img src="https://upload.wikimedia.org/wikipedia/en/2/22/Charlie_Brown.png" /> <h3> <a href='https://google.com' style='0'>A Title </a> </h3> </li>

preferences:
218.68 ms | 402 KiB | 283 Q