3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $strings = '"int2", "int4", "oid", "int8", "cash", "money", "numeric", "float4", "float8", "bpchar", "char", "char2", "char4", "char8", "char16", "varchar", "text", "name", "filename", "bytea", "bool", "bit", "date", "time", "timetz", "abstime", "timestamp", "timestamptz", "_bool", "_char", "_int2", "_int4", "_text", "_oid", "_varchar", "_int8", "_float4", "_float8", "_abstime", "_date", "_time", "_timestamp", "_numeric", "_bytea"'; $integers = 'Types.SMALLINT, Types.INTEGER, Types.INTEGER, Types.BIGINT, Types.DOUBLE, Types.DOUBLE, Types.NUMERIC, Types.REAL, Types.DOUBLE, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.BINARY, Types.BOOLEAN, Types.BIT, Types.DATE, Types.TIME, Types.TIME, Types.TIMESTAMP, Types.TIMESTAMP, Types.TIMESTAMP, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY, Types.ARRAY'; $strings = explode(',', preg_replace('/\s+/', '', $strings)); $integers = explode(',', preg_replace('/\s+/', '', $integers)); $length = count($strings); for ($i = 0; $i < $length; ++$i) { printf('map.put(%s, %s)', $strings[$i], $integers[$i]); echo PHP_EOL; }
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
map.put("int2", Types.SMALLINT) map.put("int4", Types.INTEGER) map.put("oid", Types.INTEGER) map.put("int8", Types.BIGINT) map.put("cash", Types.DOUBLE) map.put("money", Types.DOUBLE) map.put("numeric", Types.NUMERIC) map.put("float4", Types.REAL) map.put("float8", Types.DOUBLE) map.put("bpchar", Types.CHAR) map.put("char", Types.CHAR) map.put("char2", Types.CHAR) map.put("char4", Types.CHAR) map.put("char8", Types.CHAR) map.put("char16", Types.CHAR) map.put("varchar", Types.VARCHAR) map.put("text", Types.VARCHAR) map.put("name", Types.VARCHAR) map.put("filename", Types.VARCHAR) map.put("bytea", Types.BINARY) map.put("bool", Types.BOOLEAN) map.put("bit", Types.BIT) map.put("date", Types.DATE) map.put("time", Types.TIME) map.put("timetz", Types.TIME) map.put("abstime", Types.TIMESTAMP) map.put("timestamp", Types.TIMESTAMP) map.put("timestamptz", Types.TIMESTAMP) map.put("_bool", Types.ARRAY) map.put("_char", Types.ARRAY) map.put("_int2", Types.ARRAY) map.put("_int4", Types.ARRAY) map.put("_text", Types.ARRAY) map.put("_oid", Types.ARRAY) map.put("_varchar", Types.ARRAY) map.put("_int8", Types.ARRAY) map.put("_float4", Types.ARRAY) map.put("_float8", Types.ARRAY) map.put("_abstime", Types.ARRAY) map.put("_date", Types.ARRAY) map.put("_time", Types.ARRAY) map.put("_timestamp", Types.ARRAY) map.put("_numeric", Types.ARRAY) map.put("_bytea", Types.ARRAY)
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
map.put("int2", Types.SMALLINT) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("int4", Types.INTEGER) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("oid", Types.INTEGER) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("int8", Types.BIGINT) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("cash", Types.DOUBLE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("money", Types.DOUBLE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("numeric", Types.NUMERIC) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("float4", Types.REAL) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("float8", Types.DOUBLE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("bpchar", Types.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("char", Types.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("char2", Types.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("char4", Types.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("char8", Types.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("char16", Types.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("varchar", Types.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("text", Types.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("name", Types.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("filename", Types.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("bytea", Types.BINARY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("bool", Types.BOOLEAN) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("bit", Types.BIT) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("date", Types.DATE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("time", Types.TIME) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("timetz", Types.TIME) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("abstime", Types.TIMESTAMP) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("timestamp", Types.TIMESTAMP) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("timestamptz", Types.TIMESTAMP) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_bool", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_char", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_int2", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_int4", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_text", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_oid", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_varchar", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_int8", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_float4", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_float8", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_abstime", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_date", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_time", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_timestamp", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_numeric", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOLmap.put("_bytea", Types.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/8G77N on line 50 PHP_EOL