3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(array ( 0 => array ( '$match' => array ( 'user' => MongoId::__set_state(array( 'objectID' => MongoDB\BSON\ObjectID::__set_state(array( 'oid' => '5943a756fe986c4e74367267', )), )), 'created_on' => array ( '$gte' => MongoDate::__set_state(array( 'sec' => 1483228800, 'usec' => 0, )), ), 'type' => array ( '$in' => array ( 0 => 'session_completed', 1 => 'session_skipped', 2 => 'session_progress_updated', 3 => 'session_started', ), ), ), ), 1 => array ( '$group' => array ( '_id' => array ( 'year' => array ( '$year' => '$created_on', ), 'month' => array ( '$month' => '$created_on', ), 'day' => array ( '$dayOfMonth' => '$created_on', ), ), 'types' => array ( '$addToSet' => '$type', ), ), ), 2 => array ( '$project' => array ( 'type' => array ( '$switch' => array ( 'branches' => array ( 0 => array ( 'case' => array ( '$in' => array ( 0 => 'session_completed', 1 => '$types', ), ), 'then' => 'session_completed', ), 1 => array ( 'case' => array ( '$in' => array ( 0 => 'session_skipped', 1 => '$types', ), ), 'then' => 'session_skipped', ), 2 => array ( 'case' => array ( '$in' => array ( 0 => 'session_progress_updated', 1 => '$types', ), ), 'then' => 'session_progress_updated', ), 3 => array ( 'case' => array ( '$in' => array ( 0 => 'session_started', 1 => '$types', ), ), 'then' => 'session_started', ), ), 'default' => NULL, ), ), ), ), ));

preferences:
38.22 ms | 402 KiB | 5 Q