3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $types = array('Normal','Fighting','Flying','Poison','Ground','Rock','Bug','Ghost','Steel','Fire','Water','Grass','Electric','Psychic','Ice','Dragon','Dark','Fairy',); $effect_vals = array( // Nor Fig Fly Poi Gro Roc Bug Gho Ste Fir Wat Gra Ele Psy Ice Dra Dar Far array(/* Nor */ 1, 1, 1, 1, 1, .5, 1, 0, .5, 1, 1, 1, 1, 1, 1, 1, 1, 1), array(/* Fig */ 2, 1, .5, .5, 1, 2, .5, 0, 2, 1, 1, 1, 1, .5, 2, 1, 2, .5), array(/* Fly */ 1, 2, 1, 1, 1, .5, 2, 1, .5, 1, 1, 2, .5, 1, 1, 1, 1, 1), array(/* Poi */ 1, 1, 1, .5, .5, .5, 1, .5, 0, 1, 1, 2, 1, 1, 1, 1, 1, 2), array(/* Gro */ 1, 1, 0, 2, 1, 2, .5, 1, 2, 2, 1, .5, 2, 1, 1, 1, 1, 1), array(/* Roc */ 1, .5, 2, 1, .5, 1, 2, 1, .5, 2, 1, 1, 1, 1, 2, 1, 1, 1), array(/* Bug */ 1, .5, .5, .5, 1, 1, 1, .5, .5, .5, 1, 2, 1, 2, 1, 1, 2, .5), array(/* Gho */ 0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, .5, 1), array(/* Ste */ 1, 1, 1, 1, 1, 2, 1, 1, .5, .5, .5, 1, .5, 1, 2, 1, 1, 2), array(/* Fir */ 1, 1, 1, 1, 1, .5, 2, 1, 2, .5, .5, 2, 1, 1, 2, .5, 1, 1), array(/* Wat */ 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, .5, .5, 1, 1, 1, .5, 1, 1), array(/* Gra */ 1, 1, .5, .5, 2, 2, .5, 1, .5, .5, 2, .5, 1, 1, 1, .5, 1, 1), array(/* Ele */ 1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 2, .5, .5, 1, 1, .5, 1, 1), array(/* Psy */ 1, 2, 1, 2, 1, 1, 1, 1, .5, 1, 1, 1, 1, .5, 1, 1, 0, 1), array(/* Ice */ 1, 1, 2, 1, 2, 1, 1, 1, .5, .5, .5, 2, 1, 1, .5, 2, 1, 1), array(/* Dra */ 1, 1, 1, 1, 1, 1, 1, 1, .5, 1, 1, 1, 1, 1, 1, 2, 1, 0), array(/* Dar */ 1, .5, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, .5, .5), array(/* Far */ 1, 2, 1, .5, 1, 1, 1, 1, .5, .5, 1, 1, 1, 1, 1, 2, 2, 1), ); $format_prefix = '%-3.3s'; $format_header = str_repeat(' %3.3s', count($types)); $format_data = str_repeat(' %3.3s', count($types)); // header printf($format_prefix, ''); vprintf($format_header, $types); echo "\n"; // data foreach(array_map(NULL, $types, $effect_vals) as $val) { printf($format_prefix, $val[0]); vprintf($format_data, $val[1]); echo "\n"; }
Output for 4.3.2 - 7.1.7, 7.2.0
Nor Fig Fly Poi Gro Roc Bug Gho Ste Fir Wat Gra Ele Psy Ice Dra Dar Fai Nor 1 1 1 1 1 0.5 1 0 0.5 1 1 1 1 1 1 1 1 1 Fig 2 1 0.5 0.5 1 2 0.5 0 2 1 1 1 1 0.5 2 1 2 0.5 Fly 1 2 1 1 1 0.5 2 1 0.5 1 1 2 0.5 1 1 1 1 1 Poi 1 1 1 0.5 0.5 0.5 1 0.5 0 1 1 2 1 1 1 1 1 2 Gro 1 1 0 2 1 2 0.5 1 2 2 1 0.5 2 1 1 1 1 1 Roc 1 0.5 2 1 0.5 1 2 1 0.5 2 1 1 1 1 2 1 1 1 Bug 1 0.5 0.5 0.5 1 1 1 0.5 0.5 0.5 1 2 1 2 1 1 2 0.5 Gho 0 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 0.5 1 Ste 1 1 1 1 1 2 1 1 0.5 0.5 0.5 1 0.5 1 2 1 1 2 Fir 1 1 1 1 1 0.5 2 1 2 0.5 0.5 2 1 1 2 0.5 1 1 Wat 1 1 1 1 2 2 1 1 1 2 0.5 0.5 1 1 1 0.5 1 1 Gra 1 1 0.5 0.5 2 2 0.5 1 0.5 0.5 2 0.5 1 1 1 0.5 1 1 Ele 1 1 2 1 0 1 1 1 1 1 2 0.5 0.5 1 1 0.5 1 1 Psy 1 2 1 2 1 1 1 1 0.5 1 1 1 1 0.5 1 1 0 1 Ice 1 1 2 1 2 1 1 1 0.5 0.5 0.5 2 1 1 0.5 2 1 1 Dra 1 1 1 1 1 1 1 1 0.5 1 1 1 1 1 1 2 1 0 Dar 1 0.5 1 1 1 1 1 2 1 1 1 1 1 2 1 1 0.5 0.5 Fai 1 2 1 0.5 1 1 1 1 0.5 0.5 1 1 1 1 1 2 2 1
Output for 7.1.10

Process exited with code 137.
Output for 4.3.0 - 4.3.1
Normal Fighting Flying Poison Ground Rock Bug Ghost Steel Fire Water Grass Electric Psychic Ice Dragon Dark Fairy Normal 1 1 1 1 1 0.5 1 0 0.5 1 1 1 1 1 1 1 1 1 Fighting 2 1 0.5 0.5 1 2 0.5 0 2 1 1 1 1 0.5 2 1 2 0.5 Flying 1 2 1 1 1 0.5 2 1 0.5 1 1 2 0.5 1 1 1 1 1 Poison 1 1 1 0.5 0.5 0.5 1 0.5 0 1 1 2 1 1 1 1 1 2 Ground 1 1 0 2 1 2 0.5 1 2 2 1 0.5 2 1 1 1 1 1 Rock 1 0.5 2 1 0.5 1 2 1 0.5 2 1 1 1 1 2 1 1 1 Bug 1 0.5 0.5 0.5 1 1 1 0.5 0.5 0.5 1 2 1 2 1 1 2 0.5 Ghost 0 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 0.5 1 Steel 1 1 1 1 1 2 1 1 0.5 0.5 0.5 1 0.5 1 2 1 1 2 Fire 1 1 1 1 1 0.5 2 1 2 0.5 0.5 2 1 1 2 0.5 1 1 Water 1 1 1 1 2 2 1 1 1 2 0.5 0.5 1 1 1 0.5 1 1 Grass 1 1 0.5 0.5 2 2 0.5 1 0.5 0.5 2 0.5 1 1 1 0.5 1 1 Electric 1 1 2 1 0 1 1 1 1 1 2 0.5 0.5 1 1 0.5 1 1 Psychic 1 2 1 2 1 1 1 1 0.5 1 1 1 1 0.5 1 1 0 1 Ice 1 1 2 1 2 1 1 1 0.5 0.5 0.5 2 1 1 0.5 2 1 1 Dragon 1 1 1 1 1 1 1 1 0.5 1 1 1 1 1 1 2 1 0 Dark 1 0.5 1 1 1 1 1 2 1 1 1 1 1 2 1 1 0.5 0.5 Fairy 1 2 1 0.5 1 1 1 1 0.5 0.5 1 1 1 1 1 2 2 1