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('numbers.add(%s); names.add(%s);', $integers[$i], $strings[$i]); echo PHP_EOL; }
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.1.0
numbers.add(Types.SMALLINT); names.add("int2"); numbers.add(Types.INTEGER); names.add("int4"); numbers.add(Types.INTEGER); names.add("oid"); numbers.add(Types.BIGINT); names.add("int8"); numbers.add(Types.DOUBLE); names.add("cash"); numbers.add(Types.DOUBLE); names.add("money"); numbers.add(Types.NUMERIC); names.add("numeric"); numbers.add(Types.REAL); names.add("float4"); numbers.add(Types.DOUBLE); names.add("float8"); numbers.add(Types.CHAR); names.add("bpchar"); numbers.add(Types.CHAR); names.add("char"); numbers.add(Types.CHAR); names.add("char2"); numbers.add(Types.CHAR); names.add("char4"); numbers.add(Types.CHAR); names.add("char8"); numbers.add(Types.CHAR); names.add("char16"); numbers.add(Types.VARCHAR); names.add("varchar"); numbers.add(Types.VARCHAR); names.add("text"); numbers.add(Types.VARCHAR); names.add("name"); numbers.add(Types.VARCHAR); names.add("filename"); numbers.add(Types.BINARY); names.add("bytea"); numbers.add(Types.BOOLEAN); names.add("bool"); numbers.add(Types.BIT); names.add("bit"); numbers.add(Types.DATE); names.add("date"); numbers.add(Types.TIME); names.add("time"); numbers.add(Types.TIME); names.add("timetz"); numbers.add(Types.TIMESTAMP); names.add("abstime"); numbers.add(Types.TIMESTAMP); names.add("timestamp"); numbers.add(Types.TIMESTAMP); names.add("timestamptz"); numbers.add(Types.ARRAY); names.add("_bool"); numbers.add(Types.ARRAY); names.add("_char"); numbers.add(Types.ARRAY); names.add("_int2"); numbers.add(Types.ARRAY); names.add("_int4"); numbers.add(Types.ARRAY); names.add("_text"); numbers.add(Types.ARRAY); names.add("_oid"); numbers.add(Types.ARRAY); names.add("_varchar"); numbers.add(Types.ARRAY); names.add("_int8"); numbers.add(Types.ARRAY); names.add("_float4"); numbers.add(Types.ARRAY); names.add("_float8"); numbers.add(Types.ARRAY); names.add("_abstime"); numbers.add(Types.ARRAY); names.add("_date"); numbers.add(Types.ARRAY); names.add("_time"); numbers.add(Types.ARRAY); names.add("_timestamp"); numbers.add(Types.ARRAY); names.add("_numeric"); numbers.add(Types.ARRAY); names.add("_bytea");
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
numbers.add(Types.SMALLINT); names.add("int2"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.INTEGER); names.add("int4"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.INTEGER); names.add("oid"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.BIGINT); names.add("int8"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.DOUBLE); names.add("cash"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.DOUBLE); names.add("money"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.NUMERIC); names.add("numeric"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.REAL); names.add("float4"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.DOUBLE); names.add("float8"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.CHAR); names.add("bpchar"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.CHAR); names.add("char"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.CHAR); names.add("char2"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.CHAR); names.add("char4"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.CHAR); names.add("char8"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.CHAR); names.add("char16"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.VARCHAR); names.add("varchar"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.VARCHAR); names.add("text"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.VARCHAR); names.add("name"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.VARCHAR); names.add("filename"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.BINARY); names.add("bytea"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.BOOLEAN); names.add("bool"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.BIT); names.add("bit"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.DATE); names.add("date"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.TIME); names.add("time"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.TIME); names.add("timetz"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.TIMESTAMP); names.add("abstime"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.TIMESTAMP); names.add("timestamp"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.TIMESTAMP); names.add("timestamptz"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_bool"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_char"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_int2"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_int4"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_text"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_oid"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_varchar"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_int8"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_float4"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_float8"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_abstime"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_date"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_time"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_timestamp"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_numeric"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOLnumbers.add(Types.ARRAY); names.add("_bytea"); Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/FVjDf on line 50 PHP_EOL