3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Example script that will import $born events into your Mixpanel projects for your existing users. Feel free to modify. If you have a high number of users you might want to use some sort of queing system instead of a sleep command to make sure that all the requests get sent propertly. */ /* Dummy Data: This array represents the data you would fetch from your own database that would have user_ids and the date you would like to set as their birthdate. Mixpanel will use this birthdate to determine their cohort. */ // zTripUserID,RegistrationDate,RegistrationZipCode,LastBookingDate $users = array( array(1177307,1399334400,90048,1427846400), array(1171746,1420070400,90048,1422748800) ); date_default_timezone_set("America/New_York"); //set for the timezone your sign up data is using. //Constructer: new EventImporter("Project Token","Project API Key"); //Both these values are on your mixpanel accounts page: http://mixpanel.com/account/ foreach($users as $id){ $props = array(); $props['zTripUserID'] = [$id][0]; //distinct_id should be your identifier echo "\nSending $event event for ".$props['zTripUserID'])\n"; } ?>
Output for 5.5.24, 5.6.8
Parse error: syntax error, unexpected ')', expecting ',' or ';' in /in/A7PA3 on line 29
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.40
Parse error: syntax error, unexpected '[' in /in/A7PA3 on line 27
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/A7PA3 on line 27
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/A7PA3 on line 27
Process exited with code 255.

preferences:
225.63 ms | 1395 KiB | 132 Q