3v4l.org

run code in 300+ PHP versions simultaneously
<?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.3.11, 4.4.0 - 4.4.9, 5.0.2 - 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.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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

preferences:
230.96 ms | 413 KiB | 358 Q