3v4l.org

run code in 150+ 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.1.0
map.put("int2", Type.SMALLINT) map.put( "int4", Type.INTEGER) map.put( "oid", Type.INTEGER) map.put( "int8", Type.BIGINT) map.put( "cah", Type.DOUBLE) map.put( "money", Type.DOUBLE) map.put( "numeric", Type.NUMERIC) map.put( "float4", Type.REAL) map.put( "float8", Type.DOUBLE) map.put( "bpchar", Type.CHAR) map.put( "char", Type.CHAR) map.put( "char2", Type.CHAR) map.put( "char4", Type.CHAR) map.put( "char8", Type.CHAR) map.put( "char16", Type.CHAR) map.put( "varchar", Type.VARCHAR) map.put( "text", Type.VARCHAR) map.put( "name", Type.VARCHAR) map.put( "filename", Type.VARCHAR) map.put( "bytea", Type.BINARY) map.put( "bool", Type.BOOLEAN) map.put( "bit", Type.BIT) map.put( "date", Type.DATE) map.put( "time", Type.TIME) map.put( "timetz", Type.TIME) map.put( "abtime", Type.TIMESTAMP) map.put( "timetamp", Type.TIMESTAMP) map.put( "timetamptz", Type.TIMESTAMP) map.put( "_bool", Type.ARRAY) map.put( "_char", Type.ARRAY) map.put( "_int2", Type.ARRAY) map.put( "_int4", Type.ARRAY) map.put( "_text", Type.ARRAY) map.put( "_oid", Type.ARRAY) map.put( "_varchar", Type.ARRAY) map.put( "_int8", Type.ARRAY) map.put( "_float4", Type.ARRAY) map.put( "_float8", Type.ARRAY) map.put( "_abtime", Type.ARRAY) map.put( "_date", Type.ARRAY) map.put( "_time", Type.ARRAY) map.put( "_timetamp", Type.ARRAY) map.put( "_numeric", Type.ARRAY) map.put( "_bytea", Type.ARRAY)
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
map.put("int2", Type.SMALLINT) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "int4", Type.INTEGER) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "oid", Type.INTEGER) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "int8", Type.BIGINT) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "cah", Type.DOUBLE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "money", Type.DOUBLE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "numeric", Type.NUMERIC) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "float4", Type.REAL) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "float8", Type.DOUBLE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "bpchar", Type.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "char", Type.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "char2", Type.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "char4", Type.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "char8", Type.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "char16", Type.CHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "varchar", Type.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "text", Type.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "name", Type.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "filename", Type.VARCHAR) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "bytea", Type.BINARY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "bool", Type.BOOLEAN) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "bit", Type.BIT) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "date", Type.DATE) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "time", Type.TIME) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "timetz", Type.TIME) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "abtime", Type.TIMESTAMP) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "timetamp", Type.TIMESTAMP) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "timetamptz", Type.TIMESTAMP) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_bool", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_char", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_int2", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_int4", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_text", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_oid", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_varchar", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_int8", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_float4", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_float8", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_abtime", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_date", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_time", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_timetamp", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_numeric", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOLmap.put( "_bytea", Type.ARRAY) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/99gSP on line 50 PHP_EOL