eval.in

Paste #5503

PHP — PHP 5.4.6, pasted 6 years ago (json)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php

$arg = 'T';
$vehicle = ( ( $arg == 'B' ) ? 'bus' :
               ( $arg == 'A' ) ? 'airplane' :
               ( $arg == 'T' ) ? 'train' :
               ( $arg == 'C' ) ? 'car' :
               ( $arg == 'H' ) ? 'horse' :
               'feet' );
echo $vehicle;

Program Output

horse

OK (0.008 sec real, 0.011 sec wall, 13 MB, 42 syscalls)

Fork