3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fields = array( 'np.title `partner`', 'fm.fmid', 'n.nid', 'ws.sid', 'n.language', ); $extra = array('adgroup', 'campaign', 'content', 'source', 'term', 'mobile', 'tablet'); foreach ($extra as $field) { $fields[] = "{$field}.`value` `{$field}`"; } $extra = array_combine($extra, $extra); $sql = 'INSERT INTO {report_generic_report} SELECT ' . implode(', ', $fields) . ", ws.submitted, ps.doi FROM {form_map_history{$suffix}} fmh JOIN {form_map} fm ON fmh.fmid = fm.fmid JOIN {node} np ON fm.vid = np.vid JOIN {webform_submissions{$suffix}} ws ON fmh.sid = ws.sid JOIN {partner_submission{$suffix}} ps ON ws.sid = ps.sid AND fm.vid = ps.vid JOIN {node} n ON ws.nid = n.nid"; foreach ($extra as $field) { $sql .= " LEFT JOIN {webform_submission_extra{$suffix}} `{$field}` ON ws.sid = `{$field}`.sid AND `{$field}`.`name` = '{$field}'"; } $sql .= " WHERE ws.submitted BETWEEN %d AND %d"; if ($form_state['values']['language']) { $sql .= " AND n.`language` = '".$form_state['values']['language']."'"; } $sql .= " ORDER BY `partner`, sid"; print $sql;
Output for 8.3.0 - 8.3.4
Warning: Undefined variable $suffix in /in/JWDvl on line 17 Warning: Undefined variable $suffix in /in/JWDvl on line 17 Warning: Undefined variable $suffix in /in/JWDvl on line 17 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $form_state in /in/JWDvl on line 22 Warning: Trying to access array offset on null in /in/JWDvl on line 22 Warning: Trying to access array offset on null in /in/JWDvl on line 22 INSERT INTO {report_generic_report} SELECT np.title `partner`, fm.fmid, n.nid, ws.sid, n.language, adgroup.`value` `adgroup`, campaign.`value` `campaign`, content.`value` `content`, source.`value` `source`, term.`value` `term`, mobile.`value` `mobile`, tablet.`value` `tablet`, ws.submitted, ps.doi FROM {form_map_history} fmh JOIN {form_map} fm ON fmh.fmid = fm.fmid JOIN {node} np ON fm.vid = np.vid JOIN {webform_submissions} ws ON fmh.sid = ws.sid JOIN {partner_submission} ps ON ws.sid = ps.sid AND fm.vid = ps.vid JOIN {node} n ON ws.nid = n.nid LEFT JOIN {webform_submission_extra} `adgroup` ON ws.sid = `adgroup`.sid AND `adgroup`.`name` = 'adgroup' LEFT JOIN {webform_submission_extra} `campaign` ON ws.sid = `campaign`.sid AND `campaign`.`name` = 'campaign' LEFT JOIN {webform_submission_extra} `content` ON ws.sid = `content`.sid AND `content`.`name` = 'content' LEFT JOIN {webform_submission_extra} `source` ON ws.sid = `source`.sid AND `source`.`name` = 'source' LEFT JOIN {webform_submission_extra} `term` ON ws.sid = `term`.sid AND `term`.`name` = 'term' LEFT JOIN {webform_submission_extra} `mobile` ON ws.sid = `mobile`.sid AND `mobile`.`name` = 'mobile' LEFT JOIN {webform_submission_extra} `tablet` ON ws.sid = `tablet`.sid AND `tablet`.`name` = 'tablet' WHERE ws.submitted BETWEEN %d AND %d ORDER BY `partner`, sid
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17
Warning: Undefined variable $suffix in /in/JWDvl on line 17 Warning: Undefined variable $suffix in /in/JWDvl on line 17 Warning: Undefined variable $suffix in /in/JWDvl on line 17 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $suffix in /in/JWDvl on line 19 Warning: Undefined variable $form_state in /in/JWDvl on line 22 Warning: Trying to access array offset on value of type null in /in/JWDvl on line 22 Warning: Trying to access array offset on value of type null in /in/JWDvl on line 22 INSERT INTO {report_generic_report} SELECT np.title `partner`, fm.fmid, n.nid, ws.sid, n.language, adgroup.`value` `adgroup`, campaign.`value` `campaign`, content.`value` `content`, source.`value` `source`, term.`value` `term`, mobile.`value` `mobile`, tablet.`value` `tablet`, ws.submitted, ps.doi FROM {form_map_history} fmh JOIN {form_map} fm ON fmh.fmid = fm.fmid JOIN {node} np ON fm.vid = np.vid JOIN {webform_submissions} ws ON fmh.sid = ws.sid JOIN {partner_submission} ps ON ws.sid = ps.sid AND fm.vid = ps.vid JOIN {node} n ON ws.nid = n.nid LEFT JOIN {webform_submission_extra} `adgroup` ON ws.sid = `adgroup`.sid AND `adgroup`.`name` = 'adgroup' LEFT JOIN {webform_submission_extra} `campaign` ON ws.sid = `campaign`.sid AND `campaign`.`name` = 'campaign' LEFT JOIN {webform_submission_extra} `content` ON ws.sid = `content`.sid AND `content`.`name` = 'content' LEFT JOIN {webform_submission_extra} `source` ON ws.sid = `source`.sid AND `source`.`name` = 'source' LEFT JOIN {webform_submission_extra} `term` ON ws.sid = `term`.sid AND `term`.`name` = 'term' LEFT JOIN {webform_submission_extra} `mobile` ON ws.sid = `mobile`.sid AND `mobile`.`name` = 'mobile' LEFT JOIN {webform_submission_extra} `tablet` ON ws.sid = `tablet`.sid AND `tablet`.`name` = 'tablet' WHERE ws.submitted BETWEEN %d AND %d ORDER BY `partner`, sid
Output for 7.4.0 - 7.4.33
Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: form_state in /in/JWDvl on line 22 Notice: Trying to access array offset on value of type null in /in/JWDvl on line 22 Notice: Trying to access array offset on value of type null in /in/JWDvl on line 22 INSERT INTO {report_generic_report} SELECT np.title `partner`, fm.fmid, n.nid, ws.sid, n.language, adgroup.`value` `adgroup`, campaign.`value` `campaign`, content.`value` `content`, source.`value` `source`, term.`value` `term`, mobile.`value` `mobile`, tablet.`value` `tablet`, ws.submitted, ps.doi FROM {form_map_history} fmh JOIN {form_map} fm ON fmh.fmid = fm.fmid JOIN {node} np ON fm.vid = np.vid JOIN {webform_submissions} ws ON fmh.sid = ws.sid JOIN {partner_submission} ps ON ws.sid = ps.sid AND fm.vid = ps.vid JOIN {node} n ON ws.nid = n.nid LEFT JOIN {webform_submission_extra} `adgroup` ON ws.sid = `adgroup`.sid AND `adgroup`.`name` = 'adgroup' LEFT JOIN {webform_submission_extra} `campaign` ON ws.sid = `campaign`.sid AND `campaign`.`name` = 'campaign' LEFT JOIN {webform_submission_extra} `content` ON ws.sid = `content`.sid AND `content`.`name` = 'content' LEFT JOIN {webform_submission_extra} `source` ON ws.sid = `source`.sid AND `source`.`name` = 'source' LEFT JOIN {webform_submission_extra} `term` ON ws.sid = `term`.sid AND `term`.`name` = 'term' LEFT JOIN {webform_submission_extra} `mobile` ON ws.sid = `mobile`.sid AND `mobile`.`name` = 'mobile' LEFT JOIN {webform_submission_extra} `tablet` ON ws.sid = `tablet`.sid AND `tablet`.`name` = 'tablet' WHERE ws.submitted BETWEEN %d AND %d ORDER BY `partner`, sid
Output for 7.3.32 - 7.3.33
INSERT INTO {report_generic_report} SELECT np.title `partner`, fm.fmid, n.nid, ws.sid, n.language, adgroup.`value` `adgroup`, campaign.`value` `campaign`, content.`value` `content`, source.`value` `source`, term.`value` `term`, mobile.`value` `mobile`, tablet.`value` `tablet`, ws.submitted, ps.doi FROM {form_map_history} fmh JOIN {form_map} fm ON fmh.fmid = fm.fmid JOIN {node} np ON fm.vid = np.vid JOIN {webform_submissions} ws ON fmh.sid = ws.sid JOIN {partner_submission} ps ON ws.sid = ps.sid AND fm.vid = ps.vid JOIN {node} n ON ws.nid = n.nid LEFT JOIN {webform_submission_extra} `adgroup` ON ws.sid = `adgroup`.sid AND `adgroup`.`name` = 'adgroup' LEFT JOIN {webform_submission_extra} `campaign` ON ws.sid = `campaign`.sid AND `campaign`.`name` = 'campaign' LEFT JOIN {webform_submission_extra} `content` ON ws.sid = `content`.sid AND `content`.`name` = 'content' LEFT JOIN {webform_submission_extra} `source` ON ws.sid = `source`.sid AND `source`.`name` = 'source' LEFT JOIN {webform_submission_extra} `term` ON ws.sid = `term`.sid AND `term`.`name` = 'term' LEFT JOIN {webform_submission_extra} `mobile` ON ws.sid = `mobile`.sid AND `mobile`.`name` = 'mobile' LEFT JOIN {webform_submission_extra} `tablet` ON ws.sid = `tablet`.sid AND `tablet`.`name` = 'tablet' WHERE ws.submitted BETWEEN %d AND %d ORDER BY `partner`, sid
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31
Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: form_state in /in/JWDvl on line 22 INSERT INTO {report_generic_report} SELECT np.title `partner`, fm.fmid, n.nid, ws.sid, n.language, adgroup.`value` `adgroup`, campaign.`value` `campaign`, content.`value` `content`, source.`value` `source`, term.`value` `term`, mobile.`value` `mobile`, tablet.`value` `tablet`, ws.submitted, ps.doi FROM {form_map_history} fmh JOIN {form_map} fm ON fmh.fmid = fm.fmid JOIN {node} np ON fm.vid = np.vid JOIN {webform_submissions} ws ON fmh.sid = ws.sid JOIN {partner_submission} ps ON ws.sid = ps.sid AND fm.vid = ps.vid JOIN {node} n ON ws.nid = n.nid LEFT JOIN {webform_submission_extra} `adgroup` ON ws.sid = `adgroup`.sid AND `adgroup`.`name` = 'adgroup' LEFT JOIN {webform_submission_extra} `campaign` ON ws.sid = `campaign`.sid AND `campaign`.`name` = 'campaign' LEFT JOIN {webform_submission_extra} `content` ON ws.sid = `content`.sid AND `content`.`name` = 'content' LEFT JOIN {webform_submission_extra} `source` ON ws.sid = `source`.sid AND `source`.`name` = 'source' LEFT JOIN {webform_submission_extra} `term` ON ws.sid = `term`.sid AND `term`.`name` = 'term' LEFT JOIN {webform_submission_extra} `mobile` ON ws.sid = `mobile`.sid AND `mobile`.`name` = 'mobile' LEFT JOIN {webform_submission_extra} `tablet` ON ws.sid = `tablet`.sid AND `tablet`.`name` = 'tablet' WHERE ws.submitted BETWEEN %d AND %d ORDER BY `partner`, sid
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 17 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: suffix in /in/JWDvl on line 19 Notice: Undefined variable: form_state in /in/JWDvl on line 22 INSERT INTO {report_generic_report} SELECT np.title `partner`, fm.fmid, n.nid, ws.sid, n.language, adgroup.`value` `adgroup`, campaign.`value` `campaign`, content.`value` `content`, source.`value` `source`, term.`value` `term`, mobile.`value` `mobile`, tablet.`value` `tablet`, ws.submitted, ps.doi FROM {form_map_history} fmh JOIN {form_map} fm ON fmh.fmid = fm.fmid JOIN {node} np ON fm.vid = np.vid JOIN {webform_submissions} ws ON fmh.sid = ws.sid JOIN {partner_submission} ps ON ws.sid = ps.sid AND fm.vid = ps.vid JOIN {node} n ON ws.nid = n.nid LEFT JOIN {webform_submission_extra} `adgroup` ON ws.sid = `adgroup`.sid AND `adgroup`.`name` = 'adgroup' LEFT JOIN {webform_submission_extra} `campaign` ON ws.sid = `campaign`.sid AND `campaign`.`name` = 'campaign' LEFT JOIN {webform_submission_extra} `content` ON ws.sid = `content`.sid AND `content`.`name` = 'content' LEFT JOIN {webform_submission_extra} `source` ON ws.sid = `source`.sid AND `source`.`name` = 'source' LEFT JOIN {webform_submission_extra} `term` ON ws.sid = `term`.sid AND `term`.`name` = 'term' LEFT JOIN {webform_submission_extra} `mobile` ON ws.sid = `mobile`.sid AND `mobile`.`name` = 'mobile' LEFT JOIN {webform_submission_extra} `tablet` ON ws.sid = `tablet`.sid AND `tablet`.`name` = 'tablet' WHERE ws.submitted BETWEEN %d AND %d ORDER BY `partner`, sid
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_combine() in /in/JWDvl on line 15
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: array_combine() in /in/JWDvl on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_combine() in /in/JWDvl on line 15

preferences:
256.9 ms | 401 KiB | 307 Q