3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sql = "(select count(*) from rateexport where rateexport.`block # rate` > 0) as B_#," . PHP_EOL; for ($x = 1; $x < 31; $x++) { echo str_replace("#", $x, $sql); }
based on 4tus2
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.2.0
(select count(*) from rateexport where rateexport.`block 1 rate` > 0) as B_1, (select count(*) from rateexport where rateexport.`block 2 rate` > 0) as B_2, (select count(*) from rateexport where rateexport.`block 3 rate` > 0) as B_3, (select count(*) from rateexport where rateexport.`block 4 rate` > 0) as B_4, (select count(*) from rateexport where rateexport.`block 5 rate` > 0) as B_5, (select count(*) from rateexport where rateexport.`block 6 rate` > 0) as B_6, (select count(*) from rateexport where rateexport.`block 7 rate` > 0) as B_7, (select count(*) from rateexport where rateexport.`block 8 rate` > 0) as B_8, (select count(*) from rateexport where rateexport.`block 9 rate` > 0) as B_9, (select count(*) from rateexport where rateexport.`block 10 rate` > 0) as B_10, (select count(*) from rateexport where rateexport.`block 11 rate` > 0) as B_11, (select count(*) from rateexport where rateexport.`block 12 rate` > 0) as B_12, (select count(*) from rateexport where rateexport.`block 13 rate` > 0) as B_13, (select count(*) from rateexport where rateexport.`block 14 rate` > 0) as B_14, (select count(*) from rateexport where rateexport.`block 15 rate` > 0) as B_15, (select count(*) from rateexport where rateexport.`block 16 rate` > 0) as B_16, (select count(*) from rateexport where rateexport.`block 17 rate` > 0) as B_17, (select count(*) from rateexport where rateexport.`block 18 rate` > 0) as B_18, (select count(*) from rateexport where rateexport.`block 19 rate` > 0) as B_19, (select count(*) from rateexport where rateexport.`block 20 rate` > 0) as B_20, (select count(*) from rateexport where rateexport.`block 21 rate` > 0) as B_21, (select count(*) from rateexport where rateexport.`block 22 rate` > 0) as B_22, (select count(*) from rateexport where rateexport.`block 23 rate` > 0) as B_23, (select count(*) from rateexport where rateexport.`block 24 rate` > 0) as B_24, (select count(*) from rateexport where rateexport.`block 25 rate` > 0) as B_25, (select count(*) from rateexport where rateexport.`block 26 rate` > 0) as B_26, (select count(*) from rateexport where rateexport.`block 27 rate` > 0) as B_27, (select count(*) from rateexport where rateexport.`block 28 rate` > 0) as B_28, (select count(*) from rateexport where rateexport.`block 29 rate` > 0) as B_29, (select count(*) from rateexport where rateexport.`block 30 rate` > 0) as B_30,
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Y39vk on line 2 (select count(*) from rateexport where rateexport.`block 1 rate` > 0) as B_1,PHP_EOL(select count(*) from rateexport where rateexport.`block 2 rate` > 0) as B_2,PHP_EOL(select count(*) from rateexport where rateexport.`block 3 rate` > 0) as B_3,PHP_EOL(select count(*) from rateexport where rateexport.`block 4 rate` > 0) as B_4,PHP_EOL(select count(*) from rateexport where rateexport.`block 5 rate` > 0) as B_5,PHP_EOL(select count(*) from rateexport where rateexport.`block 6 rate` > 0) as B_6,PHP_EOL(select count(*) from rateexport where rateexport.`block 7 rate` > 0) as B_7,PHP_EOL(select count(*) from rateexport where rateexport.`block 8 rate` > 0) as B_8,PHP_EOL(select count(*) from rateexport where rateexport.`block 9 rate` > 0) as B_9,PHP_EOL(select count(*) from rateexport where rateexport.`block 10 rate` > 0) as B_10,PHP_EOL(select count(*) from rateexport where rateexport.`block 11 rate` > 0) as B_11,PHP_EOL(select count(*) from rateexport where rateexport.`block 12 rate` > 0) as B_12,PHP_EOL(select count(*) from rateexport where rateexport.`block 13 rate` > 0) as B_13,PHP_EOL(select count(*) from rateexport where rateexport.`block 14 rate` > 0) as B_14,PHP_EOL(select count(*) from rateexport where rateexport.`block 15 rate` > 0) as B_15,PHP_EOL(select count(*) from rateexport where rateexport.`block 16 rate` > 0) as B_16,PHP_EOL(select count(*) from rateexport where rateexport.`block 17 rate` > 0) as B_17,PHP_EOL(select count(*) from rateexport where rateexport.`block 18 rate` > 0) as B_18,PHP_EOL(select count(*) from rateexport where rateexport.`block 19 rate` > 0) as B_19,PHP_EOL(select count(*) from rateexport where rateexport.`block 20 rate` > 0) as B_20,PHP_EOL(select count(*) from rateexport where rateexport.`block 21 rate` > 0) as B_21,PHP_EOL(select count(*) from rateexport where rateexport.`block 22 rate` > 0) as B_22,PHP_EOL(select count(*) from rateexport where rateexport.`block 23 rate` > 0) as B_23,PHP_EOL(select count(*) from rateexport where rateexport.`block 24 rate` > 0) as B_24,PHP_EOL(select count(*) from rateexport where rateexport.`block 25 rate` > 0) as B_25,PHP_EOL(select count(*) from rateexport where rateexport.`block 26 rate` > 0) as B_26,PHP_EOL(select count(*) from rateexport where rateexport.`block 27 rate` > 0) as B_27,PHP_EOL(select count(*) from rateexport where rateexport.`block 28 rate` > 0) as B_28,PHP_EOL(select count(*) from rateexport where rateexport.`block 29 rate` > 0) as B_29,PHP_EOL(select count(*) from rateexport where rateexport.`block 30 rate` > 0) as B_30,PHP_EOL