3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $slider_cookie = 'commonwealhousing_visit_'.COOKIEHASH; $slider_images = array( null, '1-paperhouse.jpg', '2-girlsonsofa.jpg', '3-holdinghands.jpg', '4-girl' ); if ( empty( $_COOKIE[ $slider_cookie ] ) ) { setcookie( $slider_cookie, 1 ); $slider_image = $slider_images[1]; } else { $cookie = $_COOKIE[ $slider_cookie ]; if ( !is_int( $cookie ) or $cookie >= 4 ) { $slider_image = $slider_images[1]; setcookie( $slider_cookie, 1 ); } else { $i = $cookie + 1; $slider_image = $slider_images[ $i ]; setcookie( $slider_cookie, $i ); } }
Output for 5.2.3 - 7.1.0
Notice: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' in /in/cR5kZ on line 2 Warning: Cannot modify header information - headers already sent by (output started at /in/cR5kZ:2) in /in/cR5kZ on line 7
Output for 4.3.0 - 5.2.2
Notice: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' in /in/cR5kZ on line 2