3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = explode(",","SHANTAY,53225,350"); $sql = "SELECT * FROM dbase WHERE firstname = '" . $a[0] . "' AND currentbalance = '" . $a[1] . "'"; $sql .= " AND zip = '" . a[2] . "'"; echo $sql; ?>
based on JK3NM
Output for 7.2.0
Warning: Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /in/uRDJH on line 5 Notice: Uninitialized string offset: 2 in /in/uRDJH on line 5 SELECT * FROM dbase WHERE firstname = 'SHANTAY' AND currentbalance = '53225' AND zip = ''
Output for 5.6.8 - 7.1.10
Notice: Use of undefined constant a - assumed 'a' in /in/uRDJH on line 5 Notice: Uninitialized string offset: 2 in /in/uRDJH on line 5 SELECT * FROM dbase WHERE firstname = 'SHANTAY' AND currentbalance = '53225' AND zip = ''
Output for 5.3.22 - 5.5.35
Parse error: syntax error, unexpected '[' in /in/uRDJH on line 5
Process exited with code 255.