3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pawshake_notification_add($notification_type, $external_id, $uid = 0, $expire = -1, $variables = array()) { $notification = array( 'created' => time(), 'notification_type' => $notification_type, 'external_id' => $external_id, 'variables' => $variables, ); // User id is optional. if ($uid) { $notification['uid'] = $uid; } // If no expire is send, default to one day. if ($expire == -1) { $notification['expire'] = time() + 86400; } echo $notification['expire']; } $expire = time() + 86400 + 86400; pawshake_notification_add('thread_start', 0, 0, $expire);
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0
Notice: Undefined index: expire in /in/1vTOZ on line 22
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Undefined index: expire in /in/1vTOZ on line 22

preferences:
237.11 ms | 402 KiB | 287 Q