3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); 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'; return '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 = get_post_custom_values('GalIMG') ; ?> <li<?php if (! has_post_thumbnail() ) { echo ' class="no-img"'; } ?>> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?> <h3> <a href="<?php the_permalink(); ?>" style=" background:transparent; background-image:url(''); color:<?php $key_values2 = get_post_custom_values( 'hlwhite' ); foreach ( $key_values2 as $key => $value2 ) {echo "$value2";} ?>; display:block;"> <?php the_title(); ?> </a> </h3> </li>
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 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 - 8.3.7
<li> Fatal error: Uncaught ArgumentCountError: Too few arguments to function the_post_thumbnail(), 0 passed in /in/Rj453 on line 27 and exactly 1 expected in /in/Rj453:7 Stack trace: #0 /in/Rj453(27): the_post_thumbnail() #1 {main} thrown in /in/Rj453 on line 7
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 <li> Fatal error: Uncaught ArgumentCountError: Too few arguments to function the_post_thumbnail(), 0 passed in /in/Rj453 on line 27 and exactly 1 expected in /in/Rj453:7 Stack trace: #0 /in/Rj453(27): the_post_thumbnail() #1 {main} thrown in /in/Rj453 on line 7
Process exited with code 255.
Output for 5.6.38
Warning: Unsupported declare 'strict_types' in /in/Rj453 on line 1 <li> Warning: Missing argument 1 for the_post_thumbnail(), called in /in/Rj453 on line 27 and defined in /in/Rj453 on line 7 <h3> <a href="" style=" background:transparent; background-image:url(''); color: Warning: Invalid argument supplied for foreach() in /in/Rj453 on line 36 ; display:block;"> </a> </h3> </li>

preferences:
184.81 ms | 402 KiB | 207 Q